How to manage css efficiently

Discussion in 'CSS' started by digitalpointnet, Mar 23, 2011.

  1. #1
    Think of a site which has a static header and footer. The middle part of the site would be the content area. Think that there are a large number of unique pages which have different layouts in the content section

    According to my knowledge we will have to initiate a large number of divs.
    When doing changes to the site for the design, we will have to go through a lot of code

    My question is,
    What are the ways that we could manage css efficiently, in this kind of situation?

    Hints:

    1. Using comments in style sheets
    2. Ctrl+f and find the related div to do changes
    3. Having multiple style sheets (In which way can we do this?)
    4. Using style sheet inheritance (a new area for me)

    What do you think?
     
    digitalpointnet, Mar 23, 2011 IP
  2. style0

    style0 Peon

    Messages:
    108
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Use basic comments in the css is good. Use Firebug in firefox to right click on the page, select "inspect element" to find out its name and css class, and then search for it in the scc works like a charm.
    Search and replace, sitewide search and replace can be useful, and also, make sure that common features in elements are classed efficently. You might have 100 content divs that are basically the same, but differ in only small ways. Then make a general class for all of them, and sub classes to handle the differences.

    css inheritance is automatic and what gets inherited depends on the element type and the overlaying elements definitions. it cannot be avoided and you need to think before you code so you don't have to do a lot of corrections later in the code, for mistakes made earlier on.

    But the very best way to handle massive css edits and changes - would be to hire me :)
     
    style0, Mar 23, 2011 IP
  3. style0

    style0 Peon

    Messages:
    108
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    ...And also, implementing a css framework such as Blueprint or 960gs is a good thing. This will decrease the amount of cs you have to think about positioneing, since the framework already has all that covered.
     
    style0, Mar 24, 2011 IP