Hyperlink Basics Relative vs. Absolute Linking. Absolute Linking This type of linking always...
-
Upload
miles-rodgers -
Category
Documents
-
view
213 -
download
0
Transcript of Hyperlink Basics Relative vs. Absolute Linking. Absolute Linking This type of linking always...
![Page 1: Hyperlink Basics Relative vs. Absolute Linking. Absolute Linking This type of linking always includes the http:// prefix If you link to someone else’s.](https://reader036.fdocuments.in/reader036/viewer/2022083009/5697bfde1a28abf838cb223e/html5/thumbnails/1.jpg)
Hyperlink Basics
Relative vs. Absolute Linking
![Page 2: Hyperlink Basics Relative vs. Absolute Linking. Absolute Linking This type of linking always includes the http:// prefix If you link to someone else’s.](https://reader036.fdocuments.in/reader036/viewer/2022083009/5697bfde1a28abf838cb223e/html5/thumbnails/2.jpg)
Absolute Linking
• This type of linking always includes the http:// prefix
• If you link to someone else’s website, you use absolute references– <a href=“http://www.nike.com”>Visit Nike</a>
![Page 3: Hyperlink Basics Relative vs. Absolute Linking. Absolute Linking This type of linking always includes the http:// prefix If you link to someone else’s.](https://reader036.fdocuments.in/reader036/viewer/2022083009/5697bfde1a28abf838cb223e/html5/thumbnails/3.jpg)
Relative Linking
• Relative references are references within a folder
• When we create projects, we link to pages in our folders using relative references– <a href=“page2.html”>Go to Page 2</a>– <a href=“files/moreinfo.html”>More Info</a>
Folder
![Page 4: Hyperlink Basics Relative vs. Absolute Linking. Absolute Linking This type of linking always includes the http:// prefix If you link to someone else’s.](https://reader036.fdocuments.in/reader036/viewer/2022083009/5697bfde1a28abf838cb223e/html5/thumbnails/4.jpg)
Main folder
index.html
• To use an image that is deeper than the current folder, you use a relative reference:
• <img src=“images/pig.gif”>
images folder
pig.gif cat.gif
pages folder
1.html 2.html
![Page 5: Hyperlink Basics Relative vs. Absolute Linking. Absolute Linking This type of linking always includes the http:// prefix If you link to someone else’s.](https://reader036.fdocuments.in/reader036/viewer/2022083009/5697bfde1a28abf838cb223e/html5/thumbnails/5.jpg)
Back it up…
• If you have the main page in the site folder and then other pages in subfolders, it can get confusing….
• To move “backwards” up the folder chain, put ../ in front of the relative path:
![Page 6: Hyperlink Basics Relative vs. Absolute Linking. Absolute Linking This type of linking always includes the http:// prefix If you link to someone else’s.](https://reader036.fdocuments.in/reader036/viewer/2022083009/5697bfde1a28abf838cb223e/html5/thumbnails/6.jpg)
Main folder
index.html
• To link (on 1.html) back to the index, which is NOT in the pages folder:
• <a href=“../index.html”>Back to index</a>
images folder
pig.gif cat.gif
pages folder
1.html 2.html
![Page 7: Hyperlink Basics Relative vs. Absolute Linking. Absolute Linking This type of linking always includes the http:// prefix If you link to someone else’s.](https://reader036.fdocuments.in/reader036/viewer/2022083009/5697bfde1a28abf838cb223e/html5/thumbnails/7.jpg)
• Write the tag that would create a hyperlink to http://www.pitchforks.com and assume that the words you click on to go there are Fork Shop.
![Page 8: Hyperlink Basics Relative vs. Absolute Linking. Absolute Linking This type of linking always includes the http:// prefix If you link to someone else’s.](https://reader036.fdocuments.in/reader036/viewer/2022083009/5697bfde1a28abf838cb223e/html5/thumbnails/8.jpg)
• Write the tag that would create a hyperlink to http://www.pitchforks.com and assume that the words you click on to go there are Fork Shop.– <a href=“http://www.pitchforks.com”>Fork
Shop</a>
![Page 9: Hyperlink Basics Relative vs. Absolute Linking. Absolute Linking This type of linking always includes the http:// prefix If you link to someone else’s.](https://reader036.fdocuments.in/reader036/viewer/2022083009/5697bfde1a28abf838cb223e/html5/thumbnails/9.jpg)
• Write the tag below that would create a hyperlink to a page created in your website called fun.html that is in the subfolder called crazy. Make the clickable words More Fun Stuff.
![Page 10: Hyperlink Basics Relative vs. Absolute Linking. Absolute Linking This type of linking always includes the http:// prefix If you link to someone else’s.](https://reader036.fdocuments.in/reader036/viewer/2022083009/5697bfde1a28abf838cb223e/html5/thumbnails/10.jpg)
• Write the tag below that would create a hyperlink to a page created in your website called fun.html that is in the subfolder called crazy. Make the clickable words More Fun Stuff.– <a href=“crazy/fun.html”>More Fun Stuff</a>
![Page 11: Hyperlink Basics Relative vs. Absolute Linking. Absolute Linking This type of linking always includes the http:// prefix If you link to someone else’s.](https://reader036.fdocuments.in/reader036/viewer/2022083009/5697bfde1a28abf838cb223e/html5/thumbnails/11.jpg)
Review the graphic. Answer the following question:
• Write the tag that would be placed on
index.html to link to page2.html.
index.html page2.html button.gif
bird mam
canary.htmleagle.htmlbirdy.jpg
human.htmlhorse.htmlhorse.jpg
![Page 12: Hyperlink Basics Relative vs. Absolute Linking. Absolute Linking This type of linking always includes the http:// prefix If you link to someone else’s.](https://reader036.fdocuments.in/reader036/viewer/2022083009/5697bfde1a28abf838cb223e/html5/thumbnails/12.jpg)
Review the graphic. Answer the following question:
• Write the tag that would be placed on
index.html to link to page2.html. – <a href=“page2.html”>
index.html page2.html button.gif
bird mam
canary.htmleagle.htmlbirdy.jpg
human.htmlhorse.htmlhorse.jpg
![Page 13: Hyperlink Basics Relative vs. Absolute Linking. Absolute Linking This type of linking always includes the http:// prefix If you link to someone else’s.](https://reader036.fdocuments.in/reader036/viewer/2022083009/5697bfde1a28abf838cb223e/html5/thumbnails/13.jpg)
Review the graphic. Answer the following question:
• Write the tag that would be placed on
index.html to link to canary.html.
index.html page2.html button.gif
bird mam
canary.htmleagle.htmlbirdy.jpg
human.htmlhorse.htmlhorse.jpg
![Page 14: Hyperlink Basics Relative vs. Absolute Linking. Absolute Linking This type of linking always includes the http:// prefix If you link to someone else’s.](https://reader036.fdocuments.in/reader036/viewer/2022083009/5697bfde1a28abf838cb223e/html5/thumbnails/14.jpg)
Review the graphic. Answer the following question:
• Write the tag that would be placed on
index.html to link to canary.html. – <a href=“bird/canary.html”>
index.html page2.html button.gif
bird mam
canary.htmleagle.htmlbirdy.jpg
human.htmlhorse.htmlhorse.jpg
![Page 15: Hyperlink Basics Relative vs. Absolute Linking. Absolute Linking This type of linking always includes the http:// prefix If you link to someone else’s.](https://reader036.fdocuments.in/reader036/viewer/2022083009/5697bfde1a28abf838cb223e/html5/thumbnails/15.jpg)
Review the graphic. Answer the following question:
• Write the tag that would be placed on
canary.html to link back to index.html.
index.html page2.html button.gif
bird mam
canary.htmleagle.htmlbirdy.jpg
human.htmlhorse.htmlhorse.jpg
![Page 16: Hyperlink Basics Relative vs. Absolute Linking. Absolute Linking This type of linking always includes the http:// prefix If you link to someone else’s.](https://reader036.fdocuments.in/reader036/viewer/2022083009/5697bfde1a28abf838cb223e/html5/thumbnails/16.jpg)
Review the graphic. Answer the following question:
• Write the tag that would be placed on
canary.html to link back to index.html. – <a href=“../index.html”>
index.html page2.html button.gif
bird mam
canary.htmleagle.htmlbirdy.jpg
human.htmlhorse.htmlhorse.jpg
![Page 17: Hyperlink Basics Relative vs. Absolute Linking. Absolute Linking This type of linking always includes the http:// prefix If you link to someone else’s.](https://reader036.fdocuments.in/reader036/viewer/2022083009/5697bfde1a28abf838cb223e/html5/thumbnails/17.jpg)
Review the graphic. Answer the following question:
• Write the tag that would be placed on
canary.html to link to horse.html.
index.html page2.html button.gif
bird mam
canary.htmleagle.htmlbirdy.jpg
human.htmlhorse.htmlhorse.jpg
![Page 18: Hyperlink Basics Relative vs. Absolute Linking. Absolute Linking This type of linking always includes the http:// prefix If you link to someone else’s.](https://reader036.fdocuments.in/reader036/viewer/2022083009/5697bfde1a28abf838cb223e/html5/thumbnails/18.jpg)
Review the graphic. Answer the following question:
• Write the tag that would be placed on
canary.html to link to horse.html. – <a href=“../mam/horse.html”>
index.html page2.html button.gif
bird mam
canary.htmleagle.htmlbirdy.jpg
human.htmlhorse.htmlhorse.jpg