How to assign multiple classes to an HTML container? [closed]
Is it possible to assign multiple classes to a single HTML
container?
Something like:
<article class="column, wrapper">
Just remove the comma like this:
<article class="column wrapper">
From the standard
7.5.2 Element identifiers: the id and class attributes
Attribute definitions
id = name [CS]
This attribute assigns a name to an element. This name must be unique in a document.class = cdata-list [CS]
This attribute assigns a class name or set of class names to an element. Any number of elements may be assigned the same class name or names. Multiple class names must be separated by white space characters.
Yes, just put a space between them.
<article class="column wrapper">
Of course, there are many things you can do with CSS inheritance. Here is an article for further reading.
To assign multiple classes to an html element, include both class names within the quotations of the class attribute and have them separated by a space:
<article class="column wrapper">
In the above example, column
and wrapper
are two separate css classes, and both of their properties will be applied to the article
element.