Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS how to write single line css Re: how to write single line css

#50147
zero
Member

I think one line CSS is easier to organize. For example:

Code:
/*- – – – – – – – – –
Contents
——————–
AA01. Header
AB01. Content
——————*/

/*- – – – – – – – – –
AA01. Header
——————*/
#header { background-color: #000; width: 500px; }
#header.logo { background: transparent url(logo.gif) no-repeat; float: left; }
#header.search { float: right; padding: 5px; }
/*- – – – – – – – – –
AB01. Content
——————*/
#content { border: 3px solid #000; width: 500px; }
#content.sidebar { float: left; width: 100px; }

As you can see, I also create a table of contents at the top of my CSS file, complete with unique call numbers for each section of my css so anyone can find what they want using CTRL+F. And I organize my selectors alphabetically. OCD? Maybe, but it helps me.