Forum Moderators: not2easy
In my own CSS documents, I begin with body, but then do the classes/ids that involve page-layout, then move into font formatting and finish with link formatting.
It ends up something like this:
body{
}
#leftside{
}
#middle{
}
#rightside{
}
p h1 li etc{
}
#contextual fontstuff{
}
a{
}
#contextual a{
}
and so on.
I suppose some have the contextual elements adjacent to the parents instead of categorizing by what the id/class does.
How do you structure your CSS?
The algo to maintain such a random order is pretty easy. Just put a new definition whereever you already are in that file.
I rely on good comments within my css files to find the ones I need. The comments are then stripped of by my cms on publishing the site.
Andreas
How do you structure your CSS?
Like edit_g I split it up. I'll have one sheet dedicated to the actual layout/positioning. One sheet for the element styles and usaully one for navigation. If there are separate dirs I might have a .css folder dedicated to that directory alone.
Within the .css files I tend to start with the body tag and work my way down through id's and <div>'s. Then more general rules and classes round out the bottom. But it's all subjective- no set way at all. Comment your .css until your blue in the face too...this will help sort it out.