On Fri, 3 Sep 2004 15:19:12 +1200, Sean <[EMAIL PROTECTED]> wrote:
> Does anyone know if there is a common way of listing styles in CSS?
...
> For example, perhaps the font and inline information is first, the
> block, padding and margin information next, and then the positioning.

Sean,

I've seen more styles of styling than there are stylers!

My personal preference is to step from properties that are most likely to affect other elements on the page to properties that are least likely to do so:

- first properties of position & visibility
        (position, display, visibility, z-index...)
- then properties that affect dimension
        (height, width, margins, borders, font-size...)
- finally properties that don't affect dimension
        (text-align, background, color...)

I hold to this convention loosely; I also find it convenient to group related properties together, for example z-index with position and all the font properties together whether or not they affect box dimension, and I put padding immediately below margins because I tend to work with them simultaneously when I'm tweaking a page.

Whatever system you develop, being consistent over time will help you quickly locate properties you need to adjust, and will help other programmers (and your future self!) to modify your code more easily down the road.

Your own style of styling should make natural sense to yourself so you can move around in your files intuitively. Personally, I'd never sequence properties alphabetically because I suspect I'd constantly interrupting my thought processes of semantic and graphic organization to recall how property names are spelled -- whereas alphabetization might come as second nature to someone else with a differently wired brain.

Paul


****************************************************** 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
******************************************************



Reply via email to