> This is a question that I am curious about, I normally layout
> everything with #idname but I've noticed here and there different
> tutorials using div.classname instead for positioning.
> 
> Both seem to work, the class system seems to work easier, can anyone
> explain the positives and/or negatives to either or both approaches?

This keeps popping up here, confusingly enough

- IDs can be used one time in a document
- classes can be used many times

So, to work together with the HTML developer easily and make it easy
to grasp what is what in your CSS, I tend to:

- Use IDs for the different layout elements / modules of the page:
#boundary, #header, #nav #content #footer
- classes for repeatable elements, like .newsitem .book .employee .warning 

There is no better or worse, except for IDs having a higher
specificity and allowing easier contextual selectors (#nav li), I just
consider it a lot easier to realise what is what in your CSS without
hunting through the HTML document when I use IDs.

At @media 2005, Douglas Bowman showed some  wonderful slides on his
"best practice" approach and Andy Budd showed a step by step design of
a page.
All of these are linked at Kurafire (scroll down):
http://www.kurafire.net/log/archive/2005/06/11/atmedia-2005-report

HTH


-- 
Chris Heilmann 
Blog: http://www.wait-till-i.com
Writing: http://icant.co.uk/  
Binaries: http://www.onlinetools.org/
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to