INF-250: Web Design and Development — Pseudo Classes and Display Settings
Pseudo Classes
In CSS, we've learned how to select an element by using the element's name, its class, or ID.
But what if we want to target an element only part of the time, or target an element only under certain conditions? That's where pseudo-classes come in.
:hover
:active
:visited
:first-child
a {
color: blue;
}
a:hover {
color: red;
}
.nav-link:visited {
color: purple;
}
Try it in CodPen.
Display Settings

display: none vs visibility: hiddenThese two are easy to mix up:
display: noneremoves the element from the layout. Other elements move to fill the space.visibility: hiddenmakes the element invisible, but it still takes up space in the layout.