In the previous lesson I told you something about External Links. That’s why it’s obvious that I will tell you something about Internal Links this lesson. They can be really handy when you have a website with multiple pages. An external link isn’t really easy to use in that case. I’m sure you will do fine if you followed all the other 4 lessons. Good luck!
There aren’t many websites that don’t have multiple pages. There are usually some buttons in the menu bar you can click, that will take you to another page on that website. To create links to web pages that are part of the same website, you use internal links. There are some tips and tricks from list and reviews of website builders out there on how you can do this. Because such a second web page is usually in the same folder as the first, you can just name the file in the link. So it would be:
(a href=”file.html”)Link to the page(/a) If your website has many pages, it’s sometimes easier to put all of your web pages in different folders and subfolders. An example of a folder structure:
If we put a link on the index.html page in the folder Website, to the image slide.jpg in the Images folder. Then the link would look like this:
(a href=”Slideshow/Images/slide.jpg”)Link to slide image(/a)
The folders and files are separated by the “/” symbols again. Of course if you can go down the folders there should also be a way back up, right? If you want to put a link in the slideshow.html web page to the index.html webpage you need to use the “../” symbol. The link would look like this:
(a href=”../index.html”)Link to index.html(/a)Assignment
To practice this lesson again, we have another assignment to do. In the folder website, you need to create a folder named “private”. In that folder create another XHTML page that tells something about your hobbies. Save the file in the folder “private” and name it “hobbies.html”. Open “index.html” and create an internal link to “hobbies.html”. Create a link from “hobbies.html” to “index.html” too. When you see that both links are working, save the web pages.
This assignment may look like a lot of work, but if you want to keep doing the assignments you will have to do this one because I will use this folder and the “hobbies.html” file also in the future. I hope you will take those 5 minutes to do this assignment so you can keep following my course, because without the assignments, it might get really hard in the future!