pretty self-explanatory.
+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
2010-05-11 19:04:00
+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
2010-05-11 19:04:05
I'd give you an upvote, but you already have enough ;)
dclowd9901
2010-05-11 19:05:45
I'd give you an upvote, so I did
David Hedlund
2010-05-11 19:06:37
This upvote whoring has got to stop. ;-)
ghoppe
2010-05-11 19:11:31
+1
A:
In short, yes. Usually the class would be for styling and the id to allow direct manipulation by scripts.
developmentalinsanity
2010-05-11 19:04:48