class vs. id
class vs. id
- Started
- Last post
- 6 Responses
- thizzbobby
What is the difference between div id= and div class=
Thanks in advance.
- shitehawke0
Ids are to be used only once in your html layout. Classes can be used multiple times.
- thizzbobby0
thanks, that article really helped. got my css fix figured out. WOOT
- jsaul0
also you can use more than one class at a time like:
<div class="box"> // one class
<div class="box block"> // two classes
- unless you're designing for IE6section_014
- no u can use double classes in ie6Stugoo
- thizzbobby0
nice
- neverblink0
also an id is higher in hierarchy in the css hierchy than a class.. (the more precise, the higher in hierachy)
- 7point340
id is used with javascript. the main reason it is unique and used only once.
a class is simply a style.
+ what everyone else already said