The Learner
The Learner

Reputation: 3917

HTML class declaration

I am using html and things work well. so when keeping a ID, I have div Class= "xxx"

but I see in some of the sample files as:

div class="xxx yyy zzz";

when it is defined like this what is the id? how to read this ? If you can point me to documentation also it would be great.

Upvotes: 0

Views: 706

Answers (3)

RKumsher
RKumsher

Reputation: 2897

The div does not have an id. It has 3 classes assigned to it: xxx, yyy, and zzz. W3Schools - CSS Id and Class would be a good resource to look at

Upvotes: 1

Frank
Frank

Reputation: 15631

Have a look here, it explains about multiple classes.

I don't seem to understand the id part of your question, can you elaborate?

Upvotes: 1

James Allardice
James Allardice

Reputation: 165941

Assuming I've understood your question correctly, that is simply a div with three separate class names, "xxx", "yyy" and "zzz". An element can have as many class names as necessary.

From the HTML5 spec for the class attribute:

The attribute, if specified, must have a value that is a set of space-separated tokens representing the various classes that the element belongs to.

Upvotes: 4

Related Questions