Why don't text decorations and navigation bars work?
P粉350036783
P粉350036783 2024-04-01 21:40:16
0
1
307

I'm making a web page but I'm having problems with Navar and links. My navar items did not stay in the navar but floated down. Also, text-decoration: none; doesn't work, my links are underlined and preceded by a dot.

.navbar {
  background: black;
  height: 80px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.2rem;
  position: sticky;
  top: 0;
  z-index: 999;
}

.navbar__container {
  display: flex;
  justify-content: space-between;
  height: 80px;
  z-index: 1;
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 50px;
}

.navbar__menu {
  display: flex;
  flex-direction: row;
  align-items: center;
  list-style: none;
}

.navbar__item {
  height: 80px;
}

.navbar__links {
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 125px;
  text-decoration: none;
  height: 100%;
  transition: all 0.3s ease;
}
<nav class="navbar">
  <div class="navbar__container">
    <a href="#home" id="navbar__logo"> COLOR</a>
    <div class="navbar__toggle" id="mobile-menu">
      <span class="bar"></span>
      <span class="bar"></span>
      <span class="bar"></span>
    </div>
    <ul class="nabar__menu">
      <li class="navbar__item">
        <a href="#home" class="nabvar__links" id="hope-page">HOME</a>
      </li>
      <li class="navbar__item">
        <a href="#about" class="nabvar__links" id="about-page">ABOUT</a>
      </li>
      <li class="navbar__item">
        <a href="#services" class="nabvar__links" id="services-page">SERVICES</a>
      </li>
      <li class="navbar__btn">
        <a href="#sign-up" class="button" id="signup">SIGN UP</a>
      </li>
    </ul>
  </div>
</nav>

I tried border-bottom: none and list-style-type: none; didn't work. For the navigation bar, I tried flex-direction: row, that didn't work either.

P粉350036783
P粉350036783

reply all(1)
P粉486743671

navbar__links navbar__menu These two class names are misspelled in HTML

.navbar {
  background: black;
  height: 80px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.2rem;
  position: sticky;
  top: 0;
  z-index: 999;
}

.navbar__container {
  display: flex;
  justify-content: space-between;
  height: 80px;
  z-index: 1;
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 50px;
}

.navbar__menu {
  display: flex;
  flex-direction: row;
  align-items: center;
  list-style: none;
}

.navbar__item {
  height: 80px;
}

.navbar__links {
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 125px;
  text-decoration: none;
  height: 100%;
  transition: all 0.3s ease;
}
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!