Div Class / Div ID ??

mikel2k3

New Member
Messages
748
Reaction score
0
Points
0
Hey,

I know that this will sound like an amazingly n00b question, but im sure ill get over it.

Basicly I want to know what difference it make when making CSS layouts when you put in the html

<Div class="Something"></Div>
OR
<Div id="Something"</Div>

Does it make any difference about which one to use, and I know you can use them on conjunction with each other too.

Thanks,
Mike Distras
 

lambada

New Member
Messages
2,444
Reaction score
0
Points
0
div id should be used only once on each page
div class should be used more than once on each page

Using id more than once will spit out a validation error when using the w3c validator.
 
Last edited:

eminemix

Member
Messages
350
Reaction score
0
Points
16
It's better to use div class if you want to use it more than once.
And as lambada said, in html 4.0 and xhtml using id more than once will make the page invalid according to w3.
 

FroziceX

New Member
Messages
1
Reaction score
0
Points
0
You should use div class more than once on a page and for div id you should only use it once per page. As lambada said.
 
Top