I'm trying to create a navbar whith white bars on top of the options, but the position: absolute is not responding as I expect, even if I place it after a position: relative, the white bars are wider than the width of the options:[As you can see here](https://i.stack.imgur.com/bfueF.png)

This is the code I'm following from the tutorial, I would appreciate your help.

```css
body {
  margin: 0;
  background: #222;
  font-family: sans-serif;
  font-weight: 400;
}

.container {
  width: 80%;
  margin: 0 auto;
}

header {
  background: #151515;
}

.logo {
  float: left;
  padding: 10px 0;
}

nav {
  float: right;
}

nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

nav li {
  display: inline-block;
  margin-left: 70px;
  padding: 40px;
  position: relative;
}

nav a {
  color: white;
  text-decoration: none;
}

nav a:hover {
  color: black;
}

nav a::before {
  content: '';
  display: block;
  height: 5px;
  background-color: white;
  position: absolute;
  top: 0;
  width: 100%;
}
```

```html
<header>
  <div class="container">
    <img src="img1.png" style="max-width: 80px; margin-top: 0px;" alt="logo" class="logo">
    <nav>
      <ul>
        <li><a href="#">CONTACTO</a></li>
        <li><a href="#">REGISTRATE</a></li>
        <li><a href="#">INGRESAR</a></li>
      </ul>
    </nav>
  </div>
</header>
```