-1

I was just wondering if I should use ":" or "::" when using :(:)before and :(:)after. I am wondering if there is a difference.

TheAndersMan
  • 376
  • 3
  • 14

1 Answers1

3

The ::before notation (with two colons) was introduced in CSS3 in order to establish a discrimination between pseudo-classes and pseudo-elements. Browsers also accept the notation :before introduced in CSS 2.

Source: https://developer.mozilla.org/en-US/docs/Web/CSS/::before

As before is a pseudo ELEMENT and not a pseudo CLASS (like :hover) two colons is better (thus following the CSS3 standard).

Mr. Hugo
  • 11,887
  • 3
  • 42
  • 60