6 ms·
Attributes can be used in selectors like this `div[data-my-data="stuff"]`.
by domgor 3y ago
Attributes can be used in selectors like this `div[data-my-data="stuff"]`.
- wildrhythms 3y agoCSS is very powerful here because you can take advantage of the other attribute selectors to find partial matches: div[data-my-data^="my-prefix"] (selects by prefix) div[data-my-data$="my-suffix"] (selects by suffix) div[data-my-data*="my-substring"] (selects by substring) Quite a few more of these: https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors#syntax https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_s...