Page is a not externally linkable
- Code, Content, and Presentation
-- CSS
---- Is there a correct or standard way to write your CSS?


esllou - 1:14 pm on Jun 14, 2009 (gmt 0)


Just a few pointers from me. First, I attempt to put the CSS in my style sheets in the same order as they'll be on the page.

Your classes should describe what they do, not how they look. So class="warning", not class="red".

And I prefer to format things like this:

/* main div area surrounding everything */

#main{
width:95%;
max-width:1024px;
min-width:800px;
margin:0 auto 0 auto;
padding:0;
border:1px solid #00000
}

1. One comment line describing what it is, clear line after.
2. All extra spaces deleted...left aligned, no spaces anywhere else


Thread source:: http://www.webmasterworld.com/css/3929989.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com