Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: How to structure large CSS files  (Read 3947 times)

0 Members and 1 Guest are viewing this topic.

unlovedwarrior

    Topic Starter


    Guru

  • someday this name will be known
  • Thanked: 13
    How to structure large CSS files
    « on: November 28, 2006, 11:57:03 AM »
    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.

    Rob Pomeroy



      Prodigy

    • Systems Architect
    • Thanked: 124
      • Me
    • Experience: Expert
    • OS: Other
    Re: How to structure large CSS files
    « Reply #1 on: November 28, 2006, 02:45:40 PM »
    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.
    Only able to visit the forums sporadically, sorry.

    Geek & Dummy - honest news, reviews and howtos