CSS3 [attribute^=value] selector
Complete CSS Selector Reference Manual
Example
Set the background color of all div elements whose class attribute value begins with "test":
div[class^="test"]
{
background:#ffff00;
}
Try it »
Definition and Usage
The [attribute^=valueThe ] selector matches elements whose attribute value begins with the specified value.
Browser support





All major browsers support [attribute^=value] selector.
Note: For [attribute^=value] to work in IE8, a DOCTYPE must be declared
More examples
Example
Set the background color of all elements whose class attribute value begins with "test":
[class^="test"]
{
background:#ffff00;
}
Try it »