Yossry Helal
Yossry Helal

Reputation: 19

Why can’t I link the nav bar correctly?

I have been trying to link some of the buttons to another pages but when I click it won’t take me anywhere.

<body>
  <li class="nav-item "> <a class="nav-link" href="#About">About <span class="sr-only">(current)</span></a> </li>
  <li class="nav-item"> <a class="nav-link" href="#Our Story">Our story</a> </li>
  </li>
  <li class="nav-item">
    <a href="" id="img"> <img src="img/icons/starbucks_featured_image-1.jpg" alt="some text" height: "200" width="100"></a>
  </li>
  <li class="nav-item"> <a href="contact_US.html" class="nav-link">  social</a> </li>
  <li class="nav-item"> <a href="Social_page.html" class="nav-link">contact</a> </li>
  </ul>
</body>

Upvotes: 1

Views: 31

Answers (1)

Praveen Kumar Purushothaman
Praveen Kumar Purushothaman

Reputation: 167172

You don't have an opening <ul> (add class="nav", if it's Bootstrap) and have an extra </li> in your fourth line:

<body>
  <ul class="nav"> <!-- please add this -->
    <li class="nav-item "> <a class="nav-link" href="#About">About <span class="sr-only">(current)</span></a> </li>
    <li class="nav-item"> <a class="nav-link" href="#Our Story">Our story</a> </li>
    </li> <!-- please remove this -->
    <li class="nav-item">
      <a href="" id="img"> <img src="img/icons/starbucks_featured_image-1.jpg" alt="some text" height: "200" width="100"></a>
    </li>
    <li class="nav-item"> <a href="contact_US.html" class="nav-link">  social</a> </li>
    <li class="nav-item"> <a href="Social_page.html" class="nav-link">contact</a> </li>
  </ul>
</body>

Upvotes: 1

Related Questions