“Sel last of type”的版本间差异
本页内容
无编辑摘要 |
无编辑摘要 |
||
第1行: | 第1行: | ||
{{DISPLAYTITLE::last-of-type}}[[Category:css | {{DISPLAYTITLE::last-of-type}}[[Category:css selectors|29]] | ||
= CSS3 :last-of-type 选择器 = | = CSS3 :last-of-type 选择器 = | ||
2022年8月19日 (五) 04:50的最新版本
CSS3 :last-of-type 选择器
指定其父级的最后一个p元素的背景色:
示例
p:last-of-type
{
background:#ff0000;
}
定义和用法
- last-of-type选择器匹配元素其父级是特定类型的最后一个子元素。
提示: 和:nth-last-of-type(1)是一个意思。
浏览器支持
表格中的数字表示支持该属性的第一个浏览器版本号。
选择器 | Chrome | Internet Explorer / Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
:last-of-type | 4.0 | 9.0 | 3.5 | 3.2 | 9.6 |