SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Hybrid View

  1. #1
    SitePoint Wizard subnet_rx's Avatar
    Join Date
    Aug 2001
    Location
    Hattiesburg, MS
    Posts
    1,085
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    One file or many?

    How do you handle CSS for your entire site? One CSS contains everything, individual CSS files for every page, or a combination?

    I'm trying to figure out an easy way to organize everything so that a new page can be created easily and CSS edits isn't a search and rescue mission.

  2. #2
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    It really has to depend on the site. With additional files, you are going to create HTTP requests which can introduce latency, even if the files are cached.

    On a site I am working on now, I have two CSS files. One came with the software package and is pretty much a quagmire of styles and elements without rhyme or reason. The second is mine which follows some coding styles and a little easier to read. The second file holds my specific styles and classes while I am working on removing or cleaning up the mess provided by the software designers.
    Wayne Luke
    ------------


  3. #3
    SitePoint Enthusiast
    Join Date
    May 2004
    Location
    Vancouver, BC
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well I go for one style for each media. That means one stylesheet for print, one for screen and one for projectors if needed Makes it easier for me... But it realy depends on the person... there is no right solution

  4. #4
    SitePoint Addict
    Join Date
    Mar 2003
    Location
    UK
    Posts
    245
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Xerxos
    Well I go for one style for each media. That means one stylesheet for print, one for screen and one for projectors if needed Makes it easier for me... But it realy depends on the person... there is no right solution
    Same here, but with an addition. If there is some pages that use a selection of different CSS then the rest of the site, a set of complex form pages or a Gallery section, I seporate that in it's own stylesheet.

  5. #5
    Also available in Large Si's Avatar
    Join Date
    Sep 2002
    Location
    Walsall, UK
    Posts
    1,911
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've started implementing two stylesheets for websites on screen - a basic CSS file that sets up fonts and colours, and another stylesheet to do all the layout sections. This way, I can do a standard <link> to a stylesheet that will work on virtually all browsers and @import the more complex CSS for modern browsers.

    I then create alternate stylesheets for print etc...
    Si
    Are you a Photoshop Jedi Master? Prove it!

    Is funky house your bag? You'll love this!

    Voice
    , eyes, ears, body and hands.


  6. #6
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    I have anywhere from 2 to 4 stylesheets on my average site. Examples of each:
    • basic.css - basic font and color styles for paragraphs, links, etc. Stuff that Netscape 4 and other old browsers can understand.
    • advanced.css - advanced styles like positioning, floats, background images, margins, etc. Stuff that only new browsers understand, so this sheet gets @imported.
    • print.css - basic print styles.
    • (optional, not always included) handheld.css - styles for handheld browsers. Very simple stuff, usually my handheld stylesheet isn't more than 10 or 15 lines long.

    I always have the first two for screen and projection media (remember that Opera uses the projection stylesheet in its fullscreen mode), and 90% of the time I have the print stylesheet. The handheld sheet I've only used a couple of times because it's still new to me .


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
  •