Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers. Closed 2 years ago. Improve this question
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.
.foo
is syntactic sugar for [class ~= foo]
ref, "foo
is a word in the class
attribute".
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.
you need to put a dot between the class like
class="column.wrapper">
Success story sharing