1 # selector-pseudo-element-colon-notation
3 Specify single or double colon notation for applicable pseudo-elements.
6 a::before { color:pink; }
11 The `::` notation was chosen for *pseudo-elements* to establish a discrimination between *pseudo-classes* (which subclass existing elements) and *pseudo-elements* (which are elements not represented in the document tree).
13 However, for compatibility with existing style sheets, user agents also accept the previous one-colon notation for *pseudo-elements* introduced in CSS levels 1 and 2 (namely, `:first-line`, `:first-letter`, `:before` and `:after`).
17 `string`: `"single"|"double"`
21 Applicable pseudo-elements *must always* use the single colon notation.
23 The following patterns are considered violations:
26 a::before { color: pink; }
30 a::after { color: pink; }
34 a::first-letter { color: pink; }
38 a::first-line { color: pink; }
41 The following patterns are *not* considered violations:
44 a:before { color: pink; }
48 a:after { color: pink; }
52 a:first-letter { color: pink; }
56 a:first-line { color: pink; }
60 input::placeholder { color: pink; }
64 li::marker { font-variant-numeric: tabular-nums; }
69 Applicable pseudo-elements *must always* use the double colon notation.
71 The following patterns are considered violations:
74 a:before { color: pink; }
78 a:after { color: pink; }
82 a:first-letter { color: pink; }
86 a:first-line { color: pink; }
89 The following patterns are *not* considered violations:
92 a::before { color: pink; }
96 a::after { color: pink; }
100 a::first-letter { color: pink; }
104 a::first-line { color: pink; }
108 input::placeholder { color: pink; }
112 li::marker { font-variant-numeric: tabular-nums; }