Easy Tutorial
❮ Func Repeat Pr Border Width ❯

CSS3 [attribute^=value] Selector

Complete CSS Selector Reference

Example

Set the background color for all div elements where the class attribute value starts with "test":


Definition and Usage

The [attribute^=value] selector matches elements with an attribute value that starts with a specified value.


Browser Support

All major browsers support the [attribute^=value] selector.

Note: The [attribute^=value] selector works in IE8, but requires the declaration of <!DOCTYPE>.


More Examples

Example

Set the background color for all elements where the class attribute value starts with "test":


Complete CSS Selector Reference

❮ Func Repeat Pr Border Width ❯