Like the title says. I am trying to create a nav bar that will be fixed to the top of the screen. I want a logo in the front with 3 items aligned left and 3 items aligned right. No matter what I have tried, I cannot make the second set of 3 items align to the right.
I’ve spent an embarrassing amount of time on this.
This is my HTML:
`<nav class="nav navbar-expand-sm">
<div class="navbar-nav">
<ul class="navbar-nav">
<li><a class="menu-btn" href="live.html">Live</a></li>
<li><a class="menu-btn" href="music.html">Music</a></li>
<li><a class="menu-btn" href="merch.html">Merch</a></li>
</ul>
<a href="#"><img src="img/small-logo.jpg" class="center-band-logo justify-content-center" width=16%></a>
<ul class="navbar-nav" style="float:right">
<li style="float:right"><a class="menu-btn" href="orderalbum.html">Album</a></li>
<li style="float:right"><a class="menu-btn" href="tabs.html">Tabs</a></li>
<li style="float:right"><a class="menu-btn" href="about.html">About</a></li>
</ul>
</div>
</nav>`
This is my CSS:
.center-band-logo {
transform: translateX(-50%);
left: 50%;
position: absolute;
border: 3px outset white;
padding: 0%;
overflow: auto;
}
.nav{
background-color: black;
}
.navbar-nav{
padding-top: 2%;
padding-bottom: 1%;
}
.menu-btn{
color:white;
padding-left: 85px;
padding-right: 85px;
}
ul{
display: block;
list-style-type: none;
margin: 0;
padding: 0;
overflow: auto;
background-color: #000;
text-align: right;
}
li{
display: inline;
}
li a{
display: block;
color: white;
text-align: center;
padding: 5%;
text-decoration: none;
}
li a:hover{
background-color: #333;
text-transform: uppercase;
}
div{
overflow: auto;
}
Tried “display: block”, tried “overflow: auto”, changed the lists to divs and divs to lists and I can’t even get anything to move even a tiny bit. Feels like I’m not even editing the same CSS file.
Thank you so much in advance.
I am in great despair
Blady125 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.