Html elements can take on as many id and class attribute values as you’d like, so long as they’re enclosed in quotes and are separated by spaces. Below are two examples of an element with five id’s assigned to it and an element with five classes assigned to it. But again, an element can have as many id or class attribute values as you’d like.
> If an element has multiple ID attributes, all of them must be treated as IDs for that element for the purposes of the ID selector. Such a situation could be reached using mixtures of xml:id [XMLID], DOM3 Core [DOM-LEVEL-3-CORE], XML DTDs [XML10] and namespace-specific knowledge.
Firstly, @CrocoDillon would be right that an id cannot have space-separated values. That was a mistake on my end when I was typing up a response to @Junni. Secondly, the faux-id attribute values I gave to the div with the class attribute are actually quite valid and are an excellent candidate for allowing an element with a class attribute assigned to it to take on the naming conventions of an id. In CSS, it would be styled like so: