index.html
.style.css
index.html
on your browser.
We are going to add an About page to the above website. The About page will have an image and text, but retain the same navigational-look-and-feel of the website.
We will create a docs folder in which we will keep the about.html
and the image file user.jpg
. The following diagram shows the structure (hierachy) of the files on the system.
docs
on the site.index.html
to accomodate the links to the other pages that we might want to add e.g. About, ProjectManagement, WebsiteDevelopment, 3Dprinting, 2Dcutting etc. it is best that you add in these links as placeholders for your site.Edit the navigation section of index.html
. The code below shows how we can add placeholders for future work. We will assume that these pages will be stored in the docs
folder.
<div id="nav">
<h3>Navigation</h3>
<ul>
<li><a href="" class="selected">Home</a></li>
<li><a href="docs/safety.html">Safety</a></li>
<li><a href="">Website Dev</a></li>
<li><a href="prj/project.html">Project</a></li>
<li><a href="docs/about.html">About</a></li>
</ul>
</div>
index.html on the root of the website
docs/about.html is in the folder docs on the root
prj/project.html is in the folder prj on the root
In this way, we can map the relative locations of the different web pages we wish to host on this site.
The disadvantage of this method of usin HTML and CSS and having a Navigation page, is that should the navigtion section of main file index.html
change, you will need to edit and change each and every one of the files.
Make a copy of index.html
and save it in the docs
folder as about.html. The index file acts as a template for all other pages that follow.
Edit the contents of about.html
to reflect the position of the file and change the navigation section.
<div id="nav">
<h3>Navigation</h3>
<ul>
<li><a href="../index.html" >Home</a></li>
<li><a href="safety.html">Safety</a></li>
<li><a href="">Website Dev</a></li>
<li><a href="../prj/project.html">Project</a></li>
<li><a href="about.html" class="selected">About</a></li>
</ul>
</div>
prj
folder to find the file ‘project.html`Any files referenced directly from the about.html
file would mean that the file is also located in the same folder.
Change the contents of the main div as this holds the contents of the page.
May 2020