selector

attribute-case-flags — CSS reference

The i modifier requests ASCII case-insensitive matching; s requests ASCII case-sensitive matching. Support for s must be verified separately; this example exercises only i.

Formal Syntax & Structure

css syntaxcss
[attr="value" i] / [attr="value" s]

Working Example

Example Snippetcss
<!doctype html><html lang="en"><head><meta charset="utf-8"><title>Selector lab</title><style>:where(.sample) { color: rgb(32, 32, 32); }[data-role="note" i] { color: rgb(0, 96, 80); }</style></head><body><p id="a" class="sample" data-role="NOTE">A</p><p id="b" class="sample" data-role="other">B</p></body></html>
CSS Reference