The Syntax

Estimated reading: 1 minute 10 views
 selector:pseudo-element {property: value}

As you can see the only difference is that you place the pseudo element
after the selector, and divide the 2 with a (:) colon.
Or you can assign a class to a pseudo element as follows

  selector.p:pseudo-element {property: value}
  p{font-size: small;}
  p:first-line {font-size: medium; color: #ff0000;}
//with classes
  p.special:first-line {font-size: medium; color: #ff0000;}

Share this Doc

The Syntax

Or copy link