Home > Web Front-end > HTML Tutorial > CSS笔记之伪类与伪元素_html/css_WEB-ITnose

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

WBOY
Release: 2016-06-24 11:17:21
Original
1169 people have browsed it

    伪类分为两种: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

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

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

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template