An id should be given to only one element in your
HTML. That id can then be used to identify that element and only that element.
A class on the other hand, can apply to as many elements as you wish.
Edit: (with information brought to light later in this topic)
Ryan Fait also points out that it's possible to use
more than one class at a time on one element, but each element can only have one id.
Q. What is the advantage of identifying something through a css property? Why use id instead of class? etc
A. In
CSS there isn't a particular advantage (other than knowing when you see the css that there is only one element with that ID). You could argue that this would prevent you or other designers from using that same id on another element, and thus screwing up the design.
The real advantage (as others have mentioned) comes when you use Javascript, as you can easily identify the element in question by using its id.
QUOTE(benbramz @ Aug 17 2007, 07:44 AM) Ive noticed that quite a few people are now adding quotes from the board into their signature. I think its started an new web-radiance craze.. :P