Posted By

thesmu on 02/04/13


css html

Versions (?)

Absolute and Relative Paths

 / Published in: CSS


relative path cheat sheet

  1. Relative Path URLs
  3. Relative paths change depending upon the page the links are on. There are several rules to creating a link using the relative path:
  5. links in the same directory as the current page have no path information listed
  6. filename
  7. sub-directories are listed without any preceding slashes
  8. weekly/filename
  9. links up one directory are listed as
  10. ../filename
  11. How to determine the relative path:
  13. First define the URL of the page you are editing. In the case of this article, that would be
  14. Then look at the directory path for the page. For this article, that is /od/beginningtutorials/a/
  15. Get the URL of the page you want to link to. For this example that would be the “How to Create a Web Page with HTML” article:
  16. And look at the directory path for that page: /od/beginningtutorials/ss/
  17. Compare the two paths, to determine how to link to it. From this article I would need to step up one directory from the /a/ directory and then go back down to the /ss/ directory using the code ../ss/aasspagehtml1.htm.
  18. Write the link: <a href="../ss/aasspagehtml1.htm">How to Create a Web Page with HTML</a>

Report this snippet  

You need to login to post a comment.