css选择器——:first/last-of-type
来源:互联网 发布:声音方位识别 软件 编辑:程序博客网 时间:2024/05/29 18:34
之前介绍了,兄弟同级选择器——:nith-of-type,现在咱们继续了解下针对父级的选择器first-of-type,last-of-type。
测试代码块
效果图.
分析
:first-of-type选择器匹配元素其父级是特定类型的第一个子元素。等价于:nth-of-type(1);:last-of-type选择器匹配元素其父级是特定类型的最后一个子元素,等价于nth-last-of-type(1);
这里的父级默认是body元素,如果有个div包含p标签则此时的first-of-type同样适用,即对div中的第一个p元素进行css处理 ,last-of-type同理。
0 0
- css选择器——:first/last-of-type
- css选择器:first-of-type
- first-child first-of-type last-child last-of-type 伪类选择器总结
- jQuery 选择器 first-child和first-of-type、 last-child和last-of-type的区别
- last-of-type选择器
- first-of-type选择器
- css选择器——:only-of-type
- jQuery选择器中last-of-type和first-of-type效果案例
- 【CSS3】last-of-type选择器
- nth-last-of-type选择器
- CSS选择器 first-child 、first-of-type 和 nth-of-type()
- 【Web前端】CSS 选择器之 last-child 与 last-of-type
- 【CSS3】first-of-type选择器
- 【CSS3】nth-last-of-type(n)选择器
- css中的first-child nth-child nth-last-child() 和:nth-of-type(n)
- 【CSS3】---first-of-type选择器+nth-of-type(n)选择器
- css选择器中:first-child与:first-of-type的区别
- CSS选择器中first-child和first-of-type的区别
- PAT 1027Speech Patterns (25)
- OJ--------自守数
- windows延迟关机命令
- hql(转载)(另一个版本)
- 关于同一页面多个swiper-container会出现swiper-pagenation总数多出的问题
- css选择器——:first/last-of-type
- 【每周至少一篇 160811】函数对象_Java
- Android输入法弹出时控制Listview
- java编程思想05
- 计蒜客 泥塑课
- 将表单内容转化成json字符串,并通过ajax提交!
- sublime text2-text3 定义的不同浏览器的预览快捷键
- iOS应用性能调优的25个建议和技巧
- 我需要你们的支持我才能变得火起来!