Mid JavaScript

What are pseudo-classes and pseudo-elements?

Pseudo-class: targets an element’s state.

a:hover { color: red; }

Pseudo-element: targets part of an element.

p::first-line { font-weight: bold; }

Follow me on LinkedIn:

Key Takeaway:

:hover changes behavior; ::before and ::after insert content.

More from JavaScript Tutorial

All questions for this course