Export (0) Print
Expand All

Class

Matches the class property of the specified element.

.value { sRules }

value

String that specifies the value of the class attribute.

sRules

String that specifies one or more cascading style sheet property/value pairs.

The class property value must immediately follow a period (.). More than one class name can be specified in one style rule; to match a subset of class values, each value must be preceded by a period.

For example, the following style rule matches any H2 element whose class property has been assigned a space-separated list of values that include the pastoral and marine class names. This rule matches when class="pastoral aqua marine" but does not match when class="pastoral blue":

<style>
    h2.pastoral.marine {color: lightseagreen;}
</style> 

Community Additions

ADD
Show:
© 2014 Microsoft