CSS [attribute~=value] selector
Complete CSS Selector Reference Manual
Example
Selects all elements whose title attribute contains the word "flower"
[
title
~=
flower
]
{
background-color:
yellow
;
}
Try it »
Definition and Usage
[attribute~=valueThe ] selector is used to select elements whose attribute value contains a specified word.
Browser support





All major browsers support [attribute~=value] selector.
Note:[attribute~=value] must have a DOCTYPE declared to work in IE8 .
Related Articles
CSS Tutorial: CSS attribute selectors
Complete CSS Selector Reference Manual