Reputation: 1
I'm making a webpage but have problems with Navar and links. My Navar items are not staying in the navar, but just floating down. Also, text-decoration: none;
is not working and my links are underlined and with a dot at the front.
.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.
And for navbar, I tried flex-direction: row
, also didn't work.
Upvotes: -1
Views: 86
Reputation: 645
navbar__links
navbar__menu
these two class name in HTML is incorrectly spelled
.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="navbar__menu">
<li class="navbar__item">
<a href="#home" class="navbar__links" id="hope-page">HOME</a>
</li>
<li class="navbar__item">
<a href="#about" class="navbar__links" id="about-page">ABOUT</a>
</li>
<li class="navbar__item">
<a href="#services" class="navbar__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>
Upvotes: -2
Reputation: 49
You should check your class names and your selectors. enter image description here
Upvotes: -3