frontend
frontend
<!-- Common pattern to visually hide text for only screen readers to read -->
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
}
// select any of span elements that do not have the sr-only class
span:not(.sr-only)
// target any span element that has a class attribute set, regardless of the
attribute's value
#years span[class]
:first-of-type // target the first element that matches the selector (e.g.
h1 .flex span:first-of-type)
:last-of-type // targets the last element that matches the selector (e.g.
h1 .flex span:last-of-type)
:nth-of-type // target specific elements based on their order among siblings of
the same type (e.g. tr.total td:nth-of-type(3) targets the third `td` element
within `total` table row)
object-fit: cover
The object-fit property tells the browser how to position the element within its
container. In this case, cover will set the image to fill the container, cropping
as needed to avoid changing the aspect ratio.