Saveing some gigabytes

Discussion in 'CSS' started by crigurfingur, Feb 3, 2009.

  1. #1
    hello,

    How can I have my .html files that are in different directory use the same style.css and .gif images without having to copying them into each directory.

    Thanks.
     
    crigurfingur, Feb 3, 2009 IP
  2. bartolay13

    bartolay13 Active Member

    Messages:
    735
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    98
    #2
    insert inside <head> tag
    <link rel="stylesheet" type="text/css" src="directoryofcss.css">
     
    bartolay13, Feb 4, 2009 IP
  3. eric.r

    eric.r Peon

    Messages:
    124
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    You could either do a absolute path such as

    <link rel="stylesheet" type="text/css" src="http://somesite.com/style.css">

    Or you could use this method. Pretend the css style sheet is in a directory below yours

    <link rel="stylesheet" type="text/css" src="../style.css">

    The ../ will move to a directory below the one you are at. So if you are

    public_html -> /index/ -> index.html

    doing ../ will move into the public_html part because while you are editing index.html you are a part of the /index/ directory. Moving up one will move you to public_html. Note that I am using host gator when saying this and your root directory for your host may have a different name

    ~eric
     
    eric.r, Feb 4, 2009 IP
  4. crigurfingur

    crigurfingur Peon

    Messages:
    13
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    thanks eric.r this worked works great.
     
    crigurfingur, Feb 4, 2009 IP