好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

CSS笔记之伪类与伪元素_html/css_WEB-ITnose

伪类分为两种:UI伪类 与 结构化伪类

UI伪类:a:link{} a:hover{} a:active{} a:visited{}

input[type='text']:focus{} #title-one:target{}

结构化伪类: table tr:nth-child(even){} //even---下标为偶数的子元素

table tr:nth-child(odd){} //odd---下标为奇数的子元素

table tr:first-child{}

table tr:last-child{}

ul li:first-child{}

伪元素:最常用的伪元素莫过于 :before 与 :after

在清除浮动时就使用这两个伪元素,当然,在其他的地方也会用到。

关于伪类与伪元素的笔记就到此,如果园友知道更多的,欢迎补充。

查看更多关于CSS笔记之伪类与伪元素_html/css_WEB-ITnose的详细内容...

  阅读:35次