CSS - Assign multiple classes at the same time

By [)ia6l0 iii

You can use apply more than one class to an Element at the same time.

All you have to do is, use both the class names and separate it with a space.

<div class="class1 class2"> . . . </div>

Both the class1 and class2 css rules are applied to the div.

Related FAQs

Padding properties are specified using the Padding-Top, Padding-Bottom , Padding-Left and Padding-Right. CSS allows you to use a shorthand technique to specify these.
Margins are specified using the margin-top, margin-bottom, margin-left and margin-bottom properties. CSS allows you to specify these properties through a shorthand notation too.
In CSS , we specify the color using the hexadecimal notation: # followed by the six digits.
CSS - Assign multiple classes at the same time  (1467 Views)