Multipage Websites

Your website cannot be limited to just one page. All good websites have multiple pages and ways to navigate to those pages. The ways that you can link multiple pages can also be used to link external websites and other websites that you made.

Activity 1

For this activity, you are going to need to use Visual Studio Code. Download the app and follow the video below to show how to make a folder for your website, but instead of making a javascript file, make an HTML file. Use the previous lessons to put anything that you want in this file.

We will be using the file you just created and linking that to another webpage. Create another HTML webpage and input all the nessecary information and some text. The tag that we will be using is the <a> tag. We will be using the tag like this: <a href="insertfilenamehere.html">. Place this and a </a> around the text and the text will become linked. If the webpage you are linking to is in a folder include the folder's name and a slash before the file name (eg. <a href="secondaryWebpages/index2.html">Click here to go to index 2</a>). If the page you are linking from is in a folder add a ../ in the very front (eg. <a href="../secondaryWebpages/index2.html">Click here to go to index 2</a>) as the '../' tells the program that you are 'leaving' a folder. In the example just stated the '../' says that you are 'leaving' a folder. The 'secondaryWebpages/' tells the program that you are entering the folder titled 'secondaryWebpages'. And the 'index2.html' represents the file. This logic is also used for images, if the images are in folders (which they should be). If done correctly then your two pages will be linked.

This is an example of linking a webpage in a folder to another in a seperate folder:

Click here for your final task

©{{CodeIt}}School 2023