Export (0) Print
Expand All


Matches the class property of the specified element.

.value { sRules }


String that specifies the value of the class attribute.


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":

    h2.pastoral.marine {color: lightseagreen;}

Community Additions

© 2015 Microsoft