0

I been trying to create a navbar on my website, the problem is that when I create the folder with the html pages and when I click on it the page says this on the url C:/User/jorge/OneDrive/Desktop/rootfolder/pages/pages/education.html. Browser says this: Your file was not found It may have been moved or deleted. I am using Google chrome to create website. This is my code if needed.

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <meta http-equiv="X-UA-Compatible" content="ie=edge">

    <link href="https://fonts.googleapis.com/css?family=PT+Sans&display=swap" rel="stylesheet">

    <link rel="stylesheet" href="style.css">

    <title>Social Work | Home Page</title>

</head>

<body>

   <nav>

       <ul>

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

        <li><a href="pages/agency.html">Agency</a></li>

        <li><a href="pages/education.html">Education</a></li>

        <li><a href="pages/resource.html">Resource</a></li>

         <li><a href="pages/video.html">Videos</a></li>

       </ul>

   </nav>

   <h1>Education Page</h1>

</body>

</html>
David
  • 208,112
  • 36
  • 198
  • 279
  • Not found means just that, it wasn't found. Is the file there? – David Nov 06 '19 at 11:31
  • Yes I saved it and everything. I don't know why it says that. –  Nov 06 '19 at 11:33
  • are you sure you have your files under `pages/pages`folder? because that's where the browser is looking for it. You have a pages subfolder under the pages folder? – cloned Nov 06 '19 at 11:33
  • `/pages/pages` I reckon you are already in pages here. Try changing `href="pages/agency.html"` etc. to `href="agency.html"` and see if it works – T3 H40 Nov 06 '19 at 11:34
  • @user12331718: And you've *confirmed* that this *exact path* (including the doubled use of "pages" in the folders) is correct? Can you show us? – David Nov 06 '19 at 11:34
  • Yes it worked thank you so much. Can you explain what was the issue for future reference. –  Nov 06 '19 at 11:38
  • links starting with `./` or nothing at all are relative to your current location. You can read up on relative and absolute links for more info – T3 H40 Nov 06 '19 at 11:40
  • This info can be found here: [Basic HTML - how to set relative path to current folder?](https://stackoverflow.com/questions/296873/basic-html-how-to-set-relative-path-to-current-folder) Therefor I vote this as a duplicate – T3 H40 Nov 06 '19 at 11:42

1 Answers1

0

Just give href="education.html" in a tag Or href="/education.html" in a tag

Varunkumar Gande
  • 599
  • 6
  • 18