Thread: div id vs class
View Single Post
Old September 21st, 2007, 5:22 PM   #1 (permalink)
-RanZ-
Google Bot
Super #1
 
-RanZ-'s Avatar
 
Joined in Jun 2004
Lives in Minnesota
Hosted on Pass33/Pass70
1,036 posts
Gave thanks: 19
Thanked 10 times
div id vs class

I have just started getting into CSS layouts and was wondering something...

is it better to use div IDs or classes? I have been using IDs because thats what some of the training material I read used. Is it better to use just one of them or is a mix fine?

ex:

<div id="content_main"> </div>

using css:

div#content_main {
margin:0;
padding:0;
}


would it be better to do:

<div class="content_main"> </div>

using css:

.content_main {
margin:0;
padding:0;
}
__________________
DK Web Solutions Pass70 & Pass33
-RanZ- is offline   Reply With Quote