Posted on

IT 237 Week 4 CheckPoint Absolute and Relative Links Answer

Identify, in a Microsoft® Word document, the difference between absolute and relative links. Include the exact tag you would use to specify a relative link from index.html to imgLake.jpg. Explain how to get from index.html to imgLake.jpg in a relative fashion. Use directional instructions, as you would to give directions to a physical location.

Include the exact tag you would use to specify an absolute link from index.html to imgLake.jpg. Explain how to get from index.html to imgLake.jpg in an absolute fashion. Use directional instructions, as you would to give directions to a physical location. Post your paper as an attachment in your Assignment section.

Ans:

The difference between Absolute and Relative Links is the way you include a file on your webpage. The first one, the Absolute Link is used to point to the exact location of a file. If two Links are identical, that means that they point to the exact same fie. The second one, the Relative Link is used to point to a file or a directory in relation to the present file or directory. The best choice would be to use Relative Links since it gives you more control over the images and it really helps you with your Web site maintainance. Also, if you use Relative links it’s very easy to switch from one domain to another. You don’t need to change every src attribute from the img or style tab.

In our case the Web site has the following structure:

Root Directory: – IT237MyProject which contains the index.html file and the Images folder

Images Folder: – which contains our image: imgLake.jpg

If we use Relative to display the image we use the img tag. In the src attribute, we place the current location of the image in relation with the folder from which index.html is accessed. So the tag we will use is:

<img src=”images/imgLake.jpg” width=”…” height=””…”>

As you can see we first accessed the website, then the folder in which the photo is kept and after that we accessed the image.

If we use Absolute links we will point directly to the image:

<img src=”http://www.mywebsite.com/IT237MyProject/images/imgLake.jpg” …>. If somebody types the same URL in their img tag, the same picture will be displayed. However, if someone uses Relative Links, and types in <img src=”images/imgLake.jpg” width=”…” height=””…”>, the browser will load the imgLake.jpg from his images folder.The same link can be used by someone else, because it will not point to the same file. Different Websites, different files.

 

Leave a Reply

Your email address will not be published. Required fields are marked *