Support Forum » CSS Course

Relative Paths

(9 posts)

  1. mwang27
    Member

    For exercise 7b, I understand that the relative path that you enter in the href quotations changes, but what does it change to? For example, if I go into the books directory and go to index.html and add the link to the style sheet, would it show as href="spice_emporium_site/style_sheets/spice_style.css"?

    Posted: 2 years #
  2. Tengachaya
    Member

    I am having the same problem. I have tried "spice_emporium_site/style_sheets/spice_style.css" as you have done (seems the logical answer) but I can't create a pathway to the target stylesheet which is ultimately supposed to render my HTML document into something more lovely. Anyone got any advice on how I can do this?

    Posted: 1 year #
  3. Cary
    Member

    Maybe try this instead:

    href="style_sheets/spice_style.css"

    or this

    href="../style_sheets/spice_style.css"

    This is just my guess as I know nothing about that tutorial and how the files are arranged. Is it one of the paid for ones, or is it a free one that anyone can look at?

    Posted: 1 year #
  4. Tengachaya
    Member

    Cheers Gary,

    href="../style_sheets/spice_style.css" did the job. It is the paid for CSS Level 1 tutorial.

    I tried many different permutations, but not the dot dot slash. I take it the dot dot slash takes us to the root directory.

    Thanks for reducing my stress!

    All the best

    T

    Posted: 1 year #
  5. Cary
    Member

    The "../" takes you up one level to the directory above the html which isn't always going to be the root.

    Just "/" without the dots will always take you to the root.

    Posted: 1 year #
  6. JohnAllsopp
    Member

    Hi Cary,

    Just a little edit. / itself refers to the current directory. ./ takes you to the root directory (but depending on how the server is configured, that may not be the root of the web site).

    j

    Posted: 1 year #
  7. Tengachaya
    Member

    You know I had this problem when I done a course on HTML last year, but I had been away so long that I had forgotten. But you guys certainly prevented me from pulling out what little hair I have left, so cheers!

    Orrabest,

    T

    Posted: 1 year #
  8. Anyone ever use the BASE meta tag?

    http://www.w3.org/TR/html4/struct/links.html

    Posted: 1 year #
  9. Cary
    Member

    Sometimes I use the base tag for testing purposes.

    Posted: 1 year #

RSS feed for this topic

Reply

You must log in to post.

0.064 - 9 queries