【发布时间】:2015-09-28 19:17:24
【问题描述】:
有一堆伪元素和类:
::after, ::before, ::first-letter, ::first-line, ::selection, ::backdrop
:active, :checked, :default, :dir(), :disabled, :empty, :enabled, :first, :first-child, :first-of-type, :fullscreen, :focus, :hover, :indeterminate, :in-range, :invalid, :lang(), :last-child, :last-of-type, :left, :link, :not(), :nth-child(), :nth-last -child(), :nth-last-of-type(), :nth-of-type(), :only-child, :only-of-type, :optional, :out-of-range, :read- only, :read-write, :required, :right, :root, :scope, :target, :valid, :visited
还有其他的,比如 ::-webkit-input-placeholder、::-moz-placeholder 等等。我不知道它们是什么元素。但我认为它们是伪元素,因为它有双冒号。
有一个星号选择器* 可以选择DOM-Tree 中的所有元素。
现在,我很想知道为什么即使在 css3 或 css4 中也没有单个选择器来选择 DOM-Tree 之外的所有伪元素和伪类?
*pseudo{
color: red;
}
【问题讨论】:
标签: css css-selectors pseudo-element pseudo-class