[thelist] CSS etiquette question

Seb seb at members.evolt.org
Thu Jan 10 09:31:07 CST 2002


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Sometime around 15:00 10/01/2002, Simon Dell did verily sayeth:
>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.
-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

iQA/AwUBPD2z2b2V451Vxr52EQKdZwCgnz69iMZW6eEauM8Hha/NywrFBnwAoIOZ
4AJwyfnrfdtyfU4kOmuONq6l
=sNVA
-----END PGP SIGNATURE-----





More information about the thelist mailing list