The power of CSS attribute selectors
In general, the attribute selector can target any attribute that's attached to an HTML element. By default, the selector is case sensitive and has a lower specificity than id's and classes.
CSS attribute ends with
Conversely to looking for matched at the start, we can also look at the very end of an attribute's value by useing the $ operator. We'd match something value but not value something. This is especially interesting because we know that files always have a certain extension and by passing the full name into a data-attribute, we'd be able to match elemenets that represent PDF documents like this a[href$="pdf"].
[data-attribute$="value"] {
/* ... */
}
December 1, 2021 at 1:47:35 PM EST
*
FILLER