Re:CSS Vocabulary
by nnq on Thursday April 17, 2014 @02:01AM
(#7602183)
Why do they use `::before` instead of `:before`? Is that a typo?
[ Parent
| on HN ]
The double-colon notation is introduced in order to establish a discrimination between pseudo-classes and pseudo-elements.
Doesn't work with IE.
Re:CSS Vocabulary
by windsurfer on Thursday April 17, 2014 @02:34AM
(#7602257)
> Doesn't work with IE
That's not true. IE has supported it since IE9 at least. http://msdn.microsoft.com/en-us/library/ie/cc304078%28v=vs.8...
Pseudo-elements use two colons. A small number ("before", "after", "first-line", "first-letter") are grandfathered in as allowing either one or two, for backwards compat back to the days when there was no distinction between pseudo-elements and pseudo-classes in CSS.