By the Power of CSS…
… One is able to write really nice HTML without any inline styles and stuff that is boo-boo. And since I wrote about a bangzillion lines of CSS the last few weeks I was a bit nervous to find out that my way to structure CSS would turn out to be stupid. Turns out it isn't.
'So you super-duper CSS guru tell me how you do it then' I hear you say. Alrighty I say. Here is the general structure:
- html and body tags
- tags
- tags with id
- tags with class
If I have a case of needing to put multiple selectors on top of one code block I put it right before the first occurrence of the first selector. So in general my CSS files look like this:
html { /* css */ } body { /* css */ } a { /* css */ } p { /* css */ } div#something { /* css */ } div.somethingelse, span.somethingelseyet { /* css */ } div.somethingelse { /* css */ } span.somethingelseyet { /* css */ }
