Home > OS >  Why isn't my nav bar not taking me to the specific part of the website
Why isn't my nav bar not taking me to the specific part of the website

Time:04-20

<header>
<a href="#" >Portfo<span>lio</span></a>
<div  id="menu-icon"></div>

<ul >
<li><a href="home">Home</a></li>
<li><a href="about">About</a></li>``
<li><a href="coursework">Coursework</a></li>
<li><a href="resume">Resume</a></li>
<li><a href="contact">Contact</a></li>
</ul>
</header>

When I try to click on home about exc on my website it does not take me to it on my website and I get a error of (Your file couldn’t be accessedIt may have been moved, edited, or deleted. ERR_FILE_NOT_FOUND)

CodePudding user response:

I'am going to assume that all of your files that you're using are finishing with .html and each html file is in the same folder at same level sitting next to each other (to maintain the relative path.

So here's how you should do it.

<header>
   <a href="#" >Portfo<span>lio</span></a>
   <div  id="menu-icon"></div>

   <ul >
      <li><a href="/home.html">Home</a></li>
      <li><a href="/about.html">About</a></li>``
      <li><a href="/coursework.html">Coursework</a></li>
      <li><a href="/resume.html">Resume</a></li>
      <li><a href="/contact.html">Contact</a></li>
   </ul>
</header>

CodePudding user response:

I suppose you create a different file for all your webpages in .html For example your home page should name index.html then your should put a link like this:

<li><a href="index.html">Home</a></li>

Other pages like about you should create a new file about.html then yor link it has look like this example:

<li><a href="about.html">About</a></li>

all the files you created should be in the same folder with index.html wich is the main file of your website, otherwise you need to specific exactly the path to this files.

CodePudding user response:

<ul >
      <li><a href="home.html">Home</a></li>
      <li><a href="about.html">About</a></li>``
      <li><a href="coursework.html">Coursework</a></li>
      <li><a href="resume.html">Resume</a></li>
      <li><a href="contact.html">Contact</a></li>
   </ul>

  • Related