In a navbar, which is a ul element of width 100%, there are 8 li elements.
Each of width 12.5%, so they are supposed to occupy 100% width, without spanning to the next line.
But in actual practice, the last element moves into next line. Can anybody please find the mistake.
Note: The padding, margin, left property of the ul and body are set to 0px.
body
{
margin: 0px;
padding: 0px;
font-family:'Helvetica Neue', Helvetica, Arial;
font-size: 1.5vw;
}
#navbar
{
display: block;
position: absolute;
top: 0px;
width: 100%;
height: 5%;
margin: 0px;
padding: 0px;
color: white;
background-color: black;
}
#navbar li
{
display: inline-block;
text-align: center;
width: 12.5%;
height: 100%;
}
#navbar a
{
display: inline-block;
text-decoration: none;
color: white;
width: 100%;
height: 100%;
}
#navbar a:hover
{
background-color: #00aaff;
color: white;
}
<ul id="navbar">
<li><a href="#">Home</a></li>
<li><a href="#">About Us</a></li>
<li><a href="#">Events</a></li>
<li><a href="#">Schedule</a></li>
<li><a href="#">Our Sponsors</a></li>
<li><a href="#">Team 15</a></li>
<li><a href="#">Contact us</a></li>
<li><a style="color: #a18144" href="#">Register Now</a></li>
</ul>