difference between :after and ::after

Pseudo-elements were denoted with a single colon in CSS2,
but have been changed in CSS3
"in order to establish a discrimination between
pseudo-classes and pseudo-elements".
For compatibility reasons a single colon is still allowed for the
pseudo-elements defined in CSS 1 and CSS2.

CSS2
The ':before' and ':after' pseudo-elements can be used to
insert generated content before or after an element's content.

CSS3
Pseudo-elements

A pseudo-element is made of two colons (::) followed by
the name of the pseudo-element.

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 (namely, :first-line, :first-letter, :before and :after).
This compatibility is not allowed for the new pseudo-elements introduced in
this specification.

Are there any code examples left?
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source