DEV Community

Albert Chang
Albert Chang

Posted on

3 1

Bite-Sized CSS: Pseudo Classes vs. Pseudo Elements

Pseudo Classes

  • Starts with one colon.
  • Deals with states, such as button:hover, button:focus.
  • Selects the whole element.
  • MDN Pseudo Classes

Pseudo Elements

  • Starts with double colons, ::before, ::first-letter, etc.
  • Selects part of the element.
  • MDN Pseudo Elements

Top comments (0)

👋 Kindness is contagious

Explore a trove of insights in this engaging article, celebrated within our welcoming DEV Community. Developers from every background are invited to join and enhance our shared wisdom.

A genuine "thank you" can truly uplift someone’s day. Feel free to express your gratitude in the comments below!

On DEV, our collective exchange of knowledge lightens the road ahead and strengthens our community bonds. Found something valuable here? A small thank you to the author can make a big difference.

Okay