Export to GitHub

doctype-mirror - ClassAttribute.wiki


You are here: Home > HTML Reference > Elements > <div> element > class attribute

Usage

The class attribute can contain any number of keywords, separated by spaces. You can use each keyword for CSS styling of the element, or as part of a microformat, or for any other use.

Elements

You can use the class attribute on any element.

Browser compatibility

Compatibility table legend

| Test | IE8 | IE7 | IE6 | FF3 | FF2 | Saf3 | Op9 | Chrome | |:---------|:--------|:--------|:--------|:--------|:--------|:---------|:--------|:-----------| | div.className reflects <div class="foo"> | Y | Y | Y | Y | Y | Y | Y | Y |

Further reading