| 3:55 pm on Nov 4, 2002 (gmt 0)|
I've found that keeping the font stuff and the layout stuff in two different stylesheets is easier. Then just link to both of them. This is just down to personal preference though (and working on big sites, where keeping it all in one is not sensible at all).
| 4:07 pm on Nov 4, 2002 (gmt 0)|
I generally mirror the html flow. That way when I see something awry on my page, I know roughly where to find it.
As for general classes etc: At the bottom mainly ;)
| 4:12 pm on Nov 4, 2002 (gmt 0)|
I've been keeping mine in alphabetical order. Makes it easier to manage. I've done some research on this and cannot find anything that says the rules should be in a certain order.
| 4:39 pm on Nov 4, 2002 (gmt 0)|
I try to keep them in a completely random order, so that when I need to change a certain class the probability that I am already at the right point within the file is the same for all definitions contained within the file and all points within the file. ;)
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.
| 10:42 pm on Nov 4, 2002 (gmt 0)|
|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.
| 11:57 pm on Nov 4, 2002 (gmt 0)|
Does everyone use this [jigsaw.w3.org...] to check the CSS for errors. It is amazing how much incomplete or incorrect CSS now inhabits the web.