Locked lesson.
About this lesson
Understanding CSS Pseudo-Classes and how to use them.
Exercise files
Download this lesson’s related exercise files.
Pseudo-Class.docx58.8 KB Pseudo-Class - Solution.docx
58.9 KB
Quick reference
Pseudo-Class
Pseudo Classes let us do all kinds of weird things.
When to use
Any time you want to give an element a special state, use pseudo classes.
Instructions
Pseudo classes are separated by colons, like so:
ul li:nth-child(42) {
background-color: red;
}
Hints & tips
- Pseudo Classes are separated by colons :
Lesson notes are only available for subscribers.