1 / 4

Hyperlinks recap

Learn about the differences between absolute and relative hyperlinks and how to use them for effective website navigation. Explore examples and understand folder structures to create accurate hyperlinks.

trump
Download Presentation

Hyperlinks recap

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Hyperlinks recap DSC340 Mike Pangburn

  2. Basic idea • Absolute hyperlink • Starts navigation from the “top” of the webserver’s folder chain • Examples • href = “www.aserver.com/subfolder1/subfolder2/file.txt” • href = “/subfolder1/subfolder2/file.txt” • In this case the domain name is omitted, so the webserver assumes the current webserver • Relative hyperlink • Starts navigation from the current folder (i.e., of the file containing the link) • Meaning of “..” and “.” folder path part of link: • “..” means go up a level • “.” means start at current folder (the default) • Examples • href= “./subfolder1/subfolder2/file.txt” • href = “subfolder1/subfolder2/file.txt” • The two above links are equiv.: starting in current folder, go down two levels and go to file.txt • href = “../../subfolder3/file.txt” • Go up two folder levels, then go down into “subfolder3” and go to file.txt

  3. Folder structure for add’l examples public_html Server: gr8bikes.com mtb 700c all700c.html allmtb.html 26er 29er road CX m1.html niner.html r1.html cx1.html m2.html r2.html cx2.html

  4. Examples • From within the file allmtb.html, you want to create a hyperlink to the file niner.html • Here are some alternatives: • href = http://www.gr8bikes.com/mtb/29er/niner.html • href = “/mtb/29er/niner.html • href = “./29er/niner.html • href = “29er/niner.html • this would work to…href = “../mtb/29er/niner.html”

More Related