I'm seeing this usage a lot. Specially with the pseudo classes. What does "::" means in CSS?
.a_demo_three::before {
I'm seeing this usage a lot. Specially with the pseudo classes. What does "::" means in CSS?
.a_demo_three::before {
From the MDN:
Sometimes you will see double colons (::) instead of just one (:). This is part of CSS3 and an attempt to distinguish between pseudo-classes and pseudo-elements. Most browsers support both values.
So, when you want to use pseudo-classes like :hover
, :first-child
etc, use a single colon. If you want to use pseudo-elements, like ::before
, ::after
, ::first-letter
and so on, use double colons.
One more note: the W3C states that browsers should only accept the ::
notation for pseudo-elements introduced in CSS 3, so you should follow the recommendations above :)