为了区分伪类和伪元素,分别用:和 :: 进行区分。
常见伪类——:hover, : link, :active, :target, :not(),: focus。
常见伪元素——::first-letter, ::first-line, ::before, ::after, ::selection。
::before 和 ::after下特有的content,用于在css渲染中向元素逻辑上的头部或尾部添加内容。

:after 和 :before 可以在元素的前面和后面加入相应的内容,用到伪类元素必须的是content属性,至少为空。
网友评论