Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

CSS [attribute] selector

CSS [attribute] selector

Complete CSS SelectorComplete CSS Selector Reference Manual

Example

Select all elements with a target attribute element:

a[target]

{

background-color:yellow;

}

Try it »


Browser support

All major browsers support [attribute] selector.


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support [attribute] selector.

Note: [attribute] To work in IE8, a DOCTYPE must be declared .


Related Articles

CSS Tutorial: CSS attribute selector /a>


Complete CSS SelectorComplete CSS Selector Reference Manual