2021年3月26日星期五

Why are my navbar links only working on the homepage?

For some reason the contents of my navbar only lead to the correct page on the homepage of my website. On other pages if I try to navigate to a new one through the navbar, I get a 404 error. I used w3 school's template to create the bar. Anyone have any idea what I'm doing wrong?

HTML:

<!-- Navbar (sit on top) -->  <div class="w3-top">    <div class="w3-bar w3-white w3-wide w3-padding-small w3-card">        <div id = homeID>      <a href="index.php" class="w3-bar-item w3-button r-logo">Home</a>      </div>      <!-- Float links to the right. Hide them on small screens -->      <div class="w3-right w3-hide-small">            <div class="dropdown">        <button class="dropbtn w3-bar-item w3-button r-font">Shop A</button>        <div class="dropdown-content r-font">          <a href="pages/a-clothing.php">Clothing</a>          <a href="pages/a-makeup.php">Makeup</a>          <a href="pages/a-skin+hair.php">Skin + Hair</a>          <a href="pages/a-accessories.php">Accessories</a>          <a href="pages/a-household.php">Homeware</a>        </div>      </div>                   <div class="dropdown">        <button class="dropbtn w3-bar-item w3-button r-font">Shop B</button>        <div class="dropdown-content r-font">          <a href="pages/b-clothing.php">Clothing</a>          <a href="pages/b-makeup.php">Makeup</a>          <a href="pages/b-skin+hair.php">Skin + Hair</a>          <a href="pages/b-accessories.php">Accessories</a>          <a href="pages/b-household.php">Homeware</a>        </div>      </div>            <div class="dropdown">        <button class="dropbtn w3-bar-item w3-button r-font">Shop C</button>        <div class="dropdown-content r-font">          <a href="pages/c-clothing.php">Clothing</a>          <a href="pages/c-makeup.php">Makeup</a>          <a href="pages/c-skin+hair.php">Skin + Hair</a>          <a href="pages/c-accessories.php">Accessories</a>          <a href="pages/c-household.php">Homeware</a>        </div>      </div>             <div class="dropdown">        <button class="dropbtn w3-bar-item w3-button reddo-font">Shop D</button>        <div class="dropdown-content r-font">          <a href="pages/d-clothing.php">Clothing</a>          <a href="pages/d-makeup.php">Makeup</a>          <a href="pages/d-skin+hair.php">Skin + Hair</a>          <a href="pages/d-accessories.php">Accessories</a>          <a href="pages/d-household.php">Homeware</a>        </div>      </div>              </div>      </div>    </div>
https://stackoverflow.com/questions/66825694/why-are-my-navbar-links-only-working-on-the-homepage March 27, 2021 at 07:53AM

没有评论:

发表评论