CSS3 :last-child 选择器
CSS3 :last-child 选择器
定义和用法
:last-child选择器用来匹配父元素中最后一个子元素。
提示: p:last-child等同于p:nth-last-child(1)。
实例
浏览器支持
表格中的数字表示支持该属性的第一个浏览器版本号。
| 选择器 | |||||
|---|---|---|---|---|---|
| :last-child | 4.0 | 9.0 | 3.5 | 3.2 | 9.6 |
:last-child选择器用来匹配父元素中最后一个子元素。
提示: p:last-child等同于p:nth-last-child(1)。
表格中的数字表示支持该属性的第一个浏览器版本号。
| 选择器 | |||||
|---|---|---|---|---|---|
| :last-child | 4.0 | 9.0 | 3.5 | 3.2 | 9.6 |