kim holder kim holder - 6 months ago 34
CSS Question

Can an element have both an id and a class?

pretty self-explanatory.


Yes, an element can have one ID (which must be unique!) and multiple classes at the same time. To have multiple classes, use a space between them, here's an example:

<div id="myID" class="class1 class2 class3">Content</div>