CSS Pseudo-classes
Interactive states
a:hover { text-decoration: underline; }
button:focus-visible { outline: 3px solid #2563eb; }
input:checked { accent-color: #16a34a; }
button:disabled { opacity: .5; cursor: not-allowed; }
Keep keyboard focus visible so visitors can navigate without a mouse.
Structural pseudo-classes
li:first-child { font-weight: 700; }
tr:nth-child(even) { background: #f8fafc; }
p:not(.muted) { color: #1f2937; }
Practice
Add hover and focus-visible styles to a link and a button.
Want to learn this professionally?
Explore practical IT training at Cyber Code Academy.
View Academy Courses