SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2006
    Posts
    62
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Style Sheet use and basic rules

    I have a designer that has created around 18 css files in one site and need to explain to him about what the proper way to design with style sheets.

    But since we are a very small team/company I really dont know the hard facts myself so is there a site which gives the basic concepts or rules in how to use style sheets?

    Obviously each of his existing style sheets have slight differences but surely there must be a better way to implement his design without the need of having so many style sheets...

    Maybe a simple 10 rule list of how a good designer uses styel sheets would be perfect...

    THanks

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,696
    Mentioned
    101 Post(s)
    Tagged
    4 Thread(s)
    When it comes time for production, you can merge all of the stylesheets together based on what media they're designed for. So for example, if there are a couple of stylesheets designed for the print media, they should be kept separate (but still combined together) from the screen stylesheets.

    That will help to reduce the number off http requests required to build the page.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #3
    SitePoint Wizard
    Join Date
    Jul 2003
    Location
    Kent
    Posts
    1,921
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    If he is creating an new css file just to ADD a couple more styles for a few special pages with all other styles the same, then really, the extra styles all belong in the original. So he's doing it wrong. If he is changing existing classes eg making classX wider for some pages than others, then it might be better to invent a new class, and put it in the original file. So that's basically wrong as well.

    It's acceptable to keep the nav styles in one file and the framework/layout/text styles in another just for convenience. Mainly to stop accidentally editing part of one when it was the other you were after. I'm not keen on having lots of css files for a site, but occasionally have needed a "special" when some part needs to be altered for a couple of pages, especially when lots of other parts are referenced relative to it. ( eg #content p. #content li, etc)

  4. #4
    SitePoint Wizard bronze trophy C. Ankerstjerne's Avatar
    Join Date
    Jan 2004
    Location
    The Kingdom of Denmark
    Posts
    2,702
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    One reason for him creating multiple files could be that he wish to only includes classes relevant to the current page, to avoid forcing the user to download a very large file. Unfortunately, this probably won't work, because each file's overhead will most likely exceed the size of the omitted code.
    Christian Ankerstjerne
    <p<strong<abbr/HTML/ 4 teh win</>
    <>In Soviet Russia, website codes you!

  5. #5
    SitePoint Enthusiast ianpurton's Avatar
    Join Date
    Jul 2004
    Location
    Isle of Dogs
    Posts
    38
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It smells bad to me. You'd be surprised how much styling you can do with just small amounts of CSS.

    But, to be fair it takes time to learn CSS and how to apply it properly.

  6. #6
    SitePoint Wizard bronze trophy C. Ankerstjerne's Avatar
    Join Date
    Jan 2004
    Location
    The Kingdom of Denmark
    Posts
    2,702
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    I couldn't agree more. Looking back at some of my early style sheets, they're extremely bloated.
    Christian Ankerstjerne
    <p<strong<abbr/HTML/ 4 teh win</>
    <>In Soviet Russia, website codes you!

  7. #7
    SitePoint Addict
    Join Date
    Nov 2008
    Location
    Peterborough, Ontario, Canada
    Posts
    316
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It might be worth investing in a book for him to read.
    Build Your Own Web Site The Right Way Using HTML & CSS could be helpful (Sitepoint). Chapter 3 would be especially helpful and is available in the pdf preview of the book (in the Books section).


    The first chapter of Web Standards Creativity - Innovations in Web Design with XHTML, CSS, and DOM Scripting would be helpful specifically to the problem you're having now, but the rest of the book itself would probably be handy as well (since it sounds like he's just learning CSS).
    Have I helped you? You could help me.
    Like my business on facebook!
    Text message polls with real-time, live results.

  8. #8
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,696
    Mentioned
    101 Post(s)
    Tagged
    4 Thread(s)
    The following recent article may be of use too.
    Are You Making These 10 CSS Mistakes?
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •