views:

180

answers:

5

pretty self-explanatory.

A: 

yes.

http://www.w3.org/TR/CSS2/selector.html

ghoppe
+3  A: 

Yes. Self explanatory.

Additionally, it's common to have more than one class IE -

<div class="oneClass andAnother"></div>

but only one ID per element, and each ID should only be used once per HTML page.

Alex Mcp
+7  A: 

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>
Nick Craver
I'd give you an upvote, but you already have enough ;)
dclowd9901
I'd give you an upvote, so I did
David Hedlund
This upvote whoring has got to stop. ;-)
ghoppe
+2  A: 

Yes.

<div id="main" class="rounded">
</div>
Larsenal
+1  A: 

In short, yes. Usually the class would be for styling and the id to allow direct manipulation by scripts.

developmentalinsanity