[thelist] CSS etiquette question

Simon Dell simondl at epic.co.uk
Thu Jan 10 10:41:49 CST 2002


makes perfect sense
now i'm going to have to do plenty cut'n'paste 'cos i chose to do a "method 2"

the only real reason that i suspected method 3 (split "style" from "layout" 
into separate CSS rules) _wasn't_ worth doing was because it might add some 
dowload-time overhead, but this is probably only a minor issue, and seeing 
as i'm working on an intranet project right now, it's almost non-existent!

many thanks dood.


 >hi there all you CSS gurus...
> >
> >Just a little question of neatness and etiquette...
> >If I have two <div> tags on a particular page type template which i'm
> >going to hold some text, and which always need to be distinguished from
> >one another, which of the following would be the best way to style them up:
> >
> >3) make a . and a # splitting up "style" in the . rule and "layout" in 
> the #?
>
>Always 3. It's the most elegant (IMO) way to code from a reusability
>perspective: you only have to add a new #rule for each div tag. But then
>again, I'm just plain lazy. ;)
>
>If you're going to follow this method, it also makes sense to take it one
>step further, and split the "style" and "layout" css into two separate
>style sheets. That way you can replace your "style" css and create a new
>look for your site effortlessly without needing to duplicate your layout,
>which works wonders for user-defined styles and re-branding.
>
>Seb.





More information about the thelist mailing list