quick & easy css question

Discussion in 'CSS' started by mattb348, Jul 11, 2007.

  1. #1
    I was just curious, now that I am finnaly starting to learn and use CSS, if it is better to save an external css file in the root folder of a website? or is it ok to throw it in a sub-folder name "CSS" or something?

    Does it load faster if you have it in the root folder rather than a sub-folder named CSS???

    Lastly, does using an external css file ever make you webpage load slower, since it has to actually look up the file??

    Thanks for any info!
     
    mattb348, Jul 11, 2007 IP
  2. MrX

    MrX Well-Known Member

    Messages:
    1,563
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    140
    #2
    external css is faster because the browser will cache it so it only downloads that data once. subfolder/root won't make a difference. you're splitting hairs on that one.
     
    MrX, Jul 11, 2007 IP
  3. sarahk

    sarahk iTamer Staff

    Messages:
    28,812
    Likes Received:
    4,535
    Best Answers:
    123
    Trophy Points:
    665
    #3
    You use subfolders to make organising your files simpler. There's no impact on peformance.

    The time to look up the file is minimal and may actually make the initial load faster as the page will be "threaded" and load the different components individually - that is the page will be able to give the browser information about the images to load sooner.

    But unless your target market are on super slow dialup it's all going to happen quickly anyway.
     
    sarahk, Jul 11, 2007 IP
  4. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You can put it in the root folder, but I like to put it in its own folder called (you guessed it) styles. Then I'll name the stylesheet that gets used on the browser screen.css then print.css for the printer, and so on. That way you know what stylesheet does what.

    And in most cases you shouldn't need more than one stylesheet per media type.
     
    Dan Schulz, Jul 12, 2007 IP