On Thu, 2 Sep Cameron Adams wrote:
> I normally use the box model in combination with
> background to foreground layering to order my styles:
>
> - display
> - positioning
> - margin
> - border
> - padding
> - background
> - foreground (text)
That's the same approach I use (except 'foreground' would go in a
typography stylesheet, padding would come before border).
As for organising CSS docs, I prefer something like this on medium to
large projects (not 5 page static jobs ;)
default.css -
> Start with a global reset of padding and margins -- * {padding:0;margin:0;}
> All <body> declarations
> Main containers, their positioning, background images and decoration (ie:borders) ;
> ordered in relation to source.
>Global declarations - eg: styles whereby the selector is just the
html element name -- not typography; things like.. ul
{list-style:none;}
typography.css
> Colours, fonts, padding and margins all go in here.
> Grouped relating to how they affect each others inheritence, as well as their
> parent. (content, sidebar, footer, etc)
form.css
> Any global form styling - if the only form (besides contact) is a search form, these
> rules would go in the /* GLOBALS */ section of default.css
index.css, contact.css, about.css
> specific styles that will only ever be needed by one page are put in their own
> stylesheet to be fed solely to that page.
ie.css
> Hack sheet for all versions of IE/win - included via conditional comments.
ie55.css
> Hacks specific to IE 5.5, fed using 'mid-pass filter'.
ie5.css
>Hacks specific to IE 5, fed using 'low pass filter'.
The reason I go to so much effort to split up the IE hacks is so that
I can drop them quickly and painlessly when that blessed day finally
comes 'round.
******************************************************
The discussion list for http://webstandardsgroup.org/
Proud presenters of Web Essentials 04 http://we04.com/
Web standards, accessibility, inspiration, knowledge
To be held in Sydney, September 30 and October 1, 2004
See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
******************************************************