获取节点元素

1.css获取第几个li方法

1.1 css3 : nth-child()选择器

实例:规定属于父元素的第二个p的背景色改变

p:nth-child(2)

 {

 background-color: red;

}


1.2 css3: nth-of-type(2)选择器

实例:

p:nth-of-type(2)

扫描二维码关注公众号,回复: 2149381 查看本文章

{

background-color:res;

}

1.3 css3奇数偶数

odd:奇数

even: 偶数

猜你喜欢

转载自blog.csdn.net/itlishuang/article/details/80936152