The attribute case-sensitivity selector is mostly equivalent to the CSS2 attribute selector but with the difference set the case-(in)sensitive within the ASCII range. i
selects an element using the given attribute value in case-insensitive mode. s
sets the given attribute value to be case-sensitive. By default, the selector is case-sensitive but it depends on the document language.
# Syntax
[attribute="value" i] {
/* declarations */
}
[attribute="value" s] {
/* declarations */
}
# Example
a[href$="pdf" i] {
color: red;
}
Here it's possible to select all links which have an href attribute with the case-insensitive ending pdf
(e.g. PDF
, pdf
or even pDf
).
# Browser support
For future browser support information, also check out caniuse.com (Attribute case-sensitivity).
# Usage statistics (Alexa Top 1,250,000 sites)
Due to an extreme price increase of our statistics provider the data collection was stopped in September 2018.