CSS - 伪元素与伪类
无    2014-04-26 10:28:34    157    0    0
life

http://www.w3.org/TR/css3-selectors/#pseudo-elements

:: 伪元素

Pseudo-elements allow authors to refer to this otherwise inaccessible information. Pseudo-elements may also provide authors a way to refer to content that does not exist in the source document.

简而言之, 很多不在DOM树的元素可以通过::伪元素来访问.

  • ::first-line, ::first-letter,
  • ::before, ::after 

: 伪类

使用 :伪类 来操作的HTML本就在DOM中, 即使不用 :伪类 也可以通过添加id, class来实现.

  • :hover, :visited, :active, :focus
  • :first-child, :last-child, :nth-child(n), :nth-of-type(an+b)
  • :not

上一篇: HBase要点

下一篇: leanote 添加新功能-历史记录

157 人读过
立即登录, 发表评论.
没有帐号? 立即注册
0 条评论