Click here to Skip to main content
15,879,474 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
How do I link all of my pages in my header with the html I provide below?

HTML
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>Home</title>
	<link rel="stylesheet" type="text/css" href="style.css"/>

</head>
<body>

	<div id="nav">

			<ul>
				<h1>Ben NEWMAN</h1>
				<li><a href="#">Portfolio</a> 
				<li><a href="#">Gallery</a></li>
				<li><a href="#">About</a></li>
				<li><a href="#">Home</a></li>

			</ul>
			
	</div>

</body>
</html>


What I have tried:

google and something else that did not work.
Posted
Updated 28-May-16 2:32am
v2
Comments
Sergey Alexandrovich Kryukov 27-May-16 19:03pm    
What would you mean by "other pages in my HTML"? An HTML document is only one page.
Probably, you want to know how to navigate withing the same page using the anchors.
—SA
Philippe Mori 28-May-16 9:44am    
Read documentation or check how other website do it... At least, do some effort!

HTML
<li><a href="#">Portfolio</a> 

Instead of #, you should provide the path to the related html pages.
# refers, it will not target any URL, So by clicking the link it wont navigate to any other page, unless there is a jquery click event mapped to the anchor tags, but i am not seeing those in your code..
Change your code like below and you shall refer the links below for mapping exactly.
HTML
<h1>Ben NEWMAN</h1>
<li><a href="Portfolio.html">Portfolio</a> 
<li><a href="Gallery.html">Gallery</a></li>
.
.


refer this HTML Links[^] , HTML a href Attribute[^] for mapping the path of the page in href attribute.
 
Share this answer
 
See <a> tag usage:
HTML a tag[^]

This site is a good tutorial to learn a lot of web related things.
 
Share this answer
 
Please see my comment to the question.
Probably, you want to know how to navigate withing the same page using anchors.
The idea is very simple:
HTML
<html>
   <head><title>Anchor sample</title></head>
<body>

<ul>
<li><a href="#a1">Portfolio</a>
<li><a href="#a2">Gallery</a></li>
<li><a href="#a3">About</a></li>
<li><!-- ... --></li>
<ul>

<h1 id="a1">Portfolio</h1>

<!-- ... -->

<h1 id="a2">Gallery</h1>

<!-- ... -->

<h1 id="a3">About</h1>

<!-- ... -->

</body>
</html>

Important! The values of the attribute id should be unique on the page.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900