Product Landing Page - Build a Product Landing Page

Struggle with the ‘Each .nav-link element should have an href attribute.’
I was able to pass every other rule on the project, but I can’t seem to get past this one. I’ve been looking over through everything and I just don’t know what the problem is!
If anyone could help me, y’all would be life savers
Thank you!

<!-- file: index.html -->
<!DOCtype html>
<html lan='en'>
  <head>
    <meta charset='utf-8'/>
    <link rel='stylesheet' href='./styles.css'
  </head>
  <body>
    <title>Come on Barbie let's go Party!</title>
    
    <header id="header">
      <img id="header-img" src="https://www.freepnglogos.com/uploads/barbie-png-logo/barbie-media-png-logo-18.png"/>
      
<nav id="nav-bar">
        <button class="nav-link" href="#Welcome"><a href="#Welcome">Welcome!</a></button>
        <button class="nav-link" href="#Mission"><a href="#Mission">Mission Statement!</a></button>
        <button class="nav-link" href="#More"><a href="#More">More Barbie Fun!</a></button>
      </nav>
    </header>

Welcome to our community!

There are too many mistakes in your HTML code:

1 Like

The button element does not accept the href attribute.

The a element is not a valid descendant of a button (i.e. a button can not have a link inside it), wrapping links inside buttons doesn’t really make sense anyway.

The nav-link class should be on the a elements.

1 Like

Hello! Thank y’all so much! I was nervous since I’m very new and tend to overcomplicate things so I’m very grateful for all the tips and sources!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.