批改状态:合格
老师批语:最简单的选择器, 反而是最强大的, 伪类只是理解难度大而已,并非最重要的 , 因为它的功能完全可以用简单选择器替代的,不用伪类一样布局
-外部引用 也是通常用的方法
<style type = "text/css"> 这是在html head中直接写为内部引用格式为代码 选择器 {属性名:属性值 ; 属性名:属性值 ...}p {padding: 50px;font-size: 1.5em; /*有了插件打fz1.5 tab 就能打出来了,真方便*/}.bd { /*class选择器*/border: 1px solid rgb(228, 7, 7);}</style></head><body><div class="bd"><p>它的上下有间距</p></div></body>


有结构伪类 nth + of + type (an +b)
an 是起始点 b 是偏移量
first - of -type 第一个
nth-of-type (1n) 所有
nth-of-type (2n) 偶数
nth-of-type (2n+1) 奇数
nth-of-type (-3) 倒数三个
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号