html中怎样选择第几个,CSS选取第几个标签元素:first-child、last-child、nth-child
1、first-childfirst-child表示选择列表中的第一个标签。代码如下:li:first-child{background:#090}上面的意思是,li列表中的第一个li模块的背景颜色。2、last-childlast-child表示选择列表中的最后一个标签,代码如下:li:last-child{background:#090}3、nth-child(3)表示选择列表中的第3个标签,