1.

Solve : How to structure large CSS files?

Answer» http://friendlybit.com/css/how-to-structure-large-css-files/

Many methods exist to structure your CSS. This article tries to describe the method I use. I CALL it the “Tree method”, SINCE it structures the CSS like… that’s right, a tree structure. I want to stress that it isn’t my invention; I just describe and give reasons for its rules.

EVERYONE that has built a bigger site has had to DEAL with the mess CSS so easily BECOME. There are ids and classes all over the place, and to find where a certain class is defined you usually need to use some search feature in your editor. Matching the other way, from the CSS to the HTML is even harder; you don’t even know what file a certain class is defined in. It’s a mess.

The Tree method tries to structure the CSS into logical blocks; blocks taken from the HTML. It also aims to be easy to understand for anyone. No secret codes or difficult ordering schemes.
A nice idea in theory; the trouble is that sometimes you are obliged to use a certain order to achieve certain advanced effects. Good commenting in the CSS file is essential.


Discussion

No Comment Found