Here's another convention - I indent any 'sub' declarations. Example
I do, though only to a point. If I'm more than or 4 indents in, I don't go further. It does help me find subs of main boxes, and pseudo classes are always indented from their regular element declaration. All first children of a particular type are one indent in. If the child has an id or classname itself and has lots of children, it starts back at left and its children start indenting.
So far as I knew, I was the only weirdo in the universe doing that : )
Also curious to know which is more popular among css users - open braces... Vs. the closed system, which I used in the first example and is the one I prefer.
In Javascript, it matters (in special cases) where you put the braces. Crockford has advocated the original C style (closed) to prevent the ambiguity of semi-colon insertion in special cases. I've always had my opening brace on the same line as the declaration element... also in my Perl, also in my Javascript.
In Perl and CSS though there is absolutely no difference. I find it harder to read open braces only because I'm not used to staring at them that way 8 hours a day, but they're fine.
Off Topic:
Opera fixed that a long time ago, back on version 8 or so IIRC.
I've never used Opera before 9. But I still have a page that used the hack.
Let's see, I've dragged it out...
if
<body class="foo-bar">
then
body[class|="foo-bar"] #element {styles;}
would only target Opera, somehow simply because there was a - in the name.
But, on my current Opera, I can't see it taking effect, so they must have plugged that one since 9.28 (the version I used it on).
Bookmarks