:first-child 的坑(first-child的伪类选择器不起作用)
来源:互联网 发布:带着淘宝穿古代微盘 编辑:程序博客网 时间:2024/05/17 23:16
比如下面的代码,刚开始不知为什么 :first-child的伪类选择器不起作用,而last-child却有作用
<div class="procedureWrap"> <div class="procedure_info">尊敬的用户您好,您的入职流程需要按照如下步骤进行操作,了解流程后即可前往填写相关信息</div> <div class="procedure">填写入职资料和身份信息<br />(包括身份证账号和照片等)</div> <div class="arrow"></div> <div class="procedure">查看相关规章制度并确认</div> <div class="arrow"></div> <div class="procedure">签劳动合同阅读并手写签字等等</div> <div class="arrow"></div> <div class="procedure">社保信息录入和工资卡信息填写</div></div>.procedure:first-of-child{margin-bottom: 4px;height: 48px;line-height: 18px;}
后来查阅有关资料发现:
使用:first-child伪类时一定要保证前面没有兄弟节点,把
<div class="procedure_info">尊敬的用户您好,您的入职流程需要按照如下步骤进行操作,了解流程后即可前往填写相关信息</div>去掉就可以;或者使用div包住
<div class="procedure_info">尊敬的用户您好,您的入职流程需要按照如下步骤进行操作,了解流程后即可前往填写相关信息</div>下面的内容,然后css:
procedure:first-child
阅读全文
0 0
- :first-child 的坑(first-child的伪类选择器不起作用)
- 伪类:first-child的测试
- 结构性伪类选择器—first-child
- 伪类first-child
- 【CSS3】---结构性伪类选择器-first-child+last-child
- 那些年踩过的坑之:first-child伪类选择器
- jquery 的:first-child 和:last-child 选择器实例
- 理解Jquery的first-child选择器
- first-child first-of-type last-child last-of-type 伪类选择器总结
- first-child,关于伪类
- CSS :first-child 伪类
- css--伪类:first-child
- css选择器中:first-child与:first-of-type的区别///CSS3伪类nth-of-type(n)用法详解
- css的first-child
- 关于CSS伪类first-child的深入理解
- CSS3伪类:first-child 的学习中引发问题
- 【CSS3】结构性伪类选择器—first-child
- jquery 中 first 与 first-child选择器的区别
- 两个 list 之间的交集,并集,差集,有嵌套的交集
- hdu 1203 I NEED A OFFER!
- cmake 学习笔记(二)
- 【怎样写代码】工厂三兄弟之抽象工厂模式(二):解决方案
- WIN32 控件显示RGB 图像 / Mat 图像
- :first-child 的坑(first-child的伪类选择器不起作用)
- 新一代图形技术WebGL
- 1143: 最大值—多种进制
- 遥感影像挑选-选片技巧
- 【JavaSE笔记】Java常用类及其方法(五)_Character
- FTP-org.apache.commons.net.io.CopyStreamException: IOException caught while copying.
- 解决package ~ is not configured yet
- java项目 Nginx+Lua+Redis ip次数限制 非集群
- C++中的静态库与动态库