class attribute of the em tag (XHTML 1.1)

space-separated list of classes

With the class attribute, you can define one or several CSS classes for an element. Using it is quite simple:

<div class="myClass">Text here</div>

This will render the div tag using the myClass CSS selector. For more information on working with CSS selectors, please have a look at csspedia.net.

 

The class attribute supports more than one selector at a time. In fact, an element can be styled with any number of classes, by separating each class name with a space, like this:

<div class="bold orange small">Text here</div>

This would cause the text to be rendered using first the bold class, then the orange class and then the small class. Each selector might override properties from previous selectors, which you should take into consideration when using multiple classes.

Possible values

Value
<class>



© htmlpedia.net 2008 - 2012