CSS 3 :last-of-type 选择器

返回上一级

CSS :last-of-type 选择器匹配元素其父级是特定类型的最后一个子元素

:nth-last-of-type(1) 是一个意思

浏览器支持

下表中的数字表示支持该属性的第一个浏览器版本号

4.0 9.0 3.5 3.2 9.6

范例

指定其父级的最后一个p元素的背景色

p:last-of-type {
  background:#ff0000;
}

运行范例 »

返回上一级

CSS 参考手册

关于   |   FAQ   |   我们的愿景   |   广告投放   |  博客

  简单教程,简单编程 - IT 入门首选站

Copyright © 2013-2022 简单教程 twle.cn All Rights Reserved.