HTML/CSSIntermediate#css#selectors

What CSS attribute selectors are available?

[attr] matches presence, [attr=val] exact match, [attr^=val] starts with, [attr$=val] ends with, [attr*=val] contains substring. Useful for styling based on HTML attributes without adding classes.

Example
a[target="_blank"] { color: orange; }
input[type="checkbox"] { margin-right: 8px; }
a[href^="https://"]::after { content: ' \2197'; }

Related Questions

1
HTML/CSSIntermediate#css#selectors

What is the difference between adjacent sibling (+) and general sibling (~) combinators?

Open
2
HTML/CSSBeginner#css#transitions

How do CSS transitions work?

Open
3
HTML/CSSIntermediate#css#animations

How do CSS keyframe animations work?

Open