3 replies [Last post]
AGS
Offline
newbie
Last seen: 14 years 37 weeks ago
Joined: 2005-11-17
Posts: 2
Points: 0

My question is rather abstract. I’ve seen several times in CSS rules that names of pseudo elements like :before and :after are used with doubled colon (for example ::before), and (what really puzzles me) it works at least for Opera 8.5 and Firefox 1.5. For what reason they are used like that? Are there some implications?

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 5 years 30 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

:before and :after pseudo-elements

Where have you seen these used with this syntax? as far as I'm aware this is not correct and surprised it works.

Hugo.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

AGS
Offline
newbie
Last seen: 14 years 37 weeks ago
Joined: 2005-11-17
Posts: 2
Points: 0

:before and :after pseudo-elements

Hugo wrote:
Where have you seen these used with this syntax? as far as I'm aware this is not correct and surprised it works.

Hugo.

Thank you. I've recently found an answer. I've missed it somehow. It's just CSS3 syntax for pseudo-elements.
http://www.w3.org/TR/css3-selectors/#pseudo-elements

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 5 years 30 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

:before and :after pseudo-elements

Ah, I see :roll:

W3C wrote:
Note: this :: notation is introduced by the current document in order to establish a discrimination between pseudo-classes and pseudo-elements. For compatibility with existing style sheets, user agents must also accept the previous one-colon notation for pseudo-elements introduced in CSS levels 1 and 2. This compatibility is not allowed for the new pseudo-elements introduced in CSS level 3.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me