I am new to css and html5 and try to make my menu bar work correctly. This is a horizontal menu bar with a drop-down list function. Before I focused the menu bar, there were no spaces between the navigation buttons and the drop-down menu buttons. After centering, they now have a space between them, which is annoying, because when you go between them, especially on the drop-down, you lose the drop-down menu due to the space. Therefore, I am trying to remove the space (not the borders) between the buttons. Thank you so much for your help, here is the code:
CSS
nav {
background-color:#333333;
height:40px;
width:100%;
}
nav ul {
font-family: Sonoma, Arial;
font-size: 20px;
margin: 0;
padding: 0;
list-style: none;
text-align:center;
}
nav ul li {
display: inline-block;
position: relative;
}
nav li ul {
display: none;
}
nav ul li a {
display: inline-block;
text-decoration: none;
background: #666666;
color: #ffffff;
padding: 5px 20px 3px 15px;
margin-left: 1px;
white-space: nowrap;
height:30px;
width:90px;
text-align:center;
border-right: 3px solid black;
border-left: 3px solid black;
}
nav ul li a:hover {
background: #999999;
}
nav li:hover ul {
display: block;
position: absolute;
height:30px;
}
nav li:hover li {
float: none;
font-size: 11px;
}
nav li:hover a {
background: #534635;
height:30px;
}
nav li:hover li a:hover {
background: #999999;
}
nav ul li ul li a {
text-align:left;
}
HTML FOR NAV:
<nav>
<ul>
<li><a href="/">Home</a></li>
<li><a href="/about">About Us</a>
<ul>
<li><a href="/crew">Our Crew</a></li>
<li><a href="/history">History</a></li>
<li><a href="/vision">Vision</a></li>
</ul>
</li>
<li><a href="/products">Services</a>
<ul>
<li><a href="/carpentry">Carpentry</a></li>
<li><a href="/waterproof">Waterproofing</a></li>
<li><a href="/concrete">Concrete</a></li>
<li><a href="/masonry">Masonry</a></li>
<li><a href="/prop">Property Maintenance</a></li>
<li><a href="/metal">Metal Construction</a></li>
<li><a href="/design">Interior Design</a></li>
<li><a href="/demo">Demo & Salvage</a></li>
</ul>
</li>
<li><a href="/services">Portfolio</a>
</li>
<li><a href="/contact">Contact</a>
<ul>
<li><a href="/email">Via Email</a></li>
<li><a href="/contact_form">Web Form</a></li>
<li><a href="/pigeon">Carrier Pigeon</a></li>
</ul>
</li>
</ul>
</nav>
If you could explain what changes should happen and why he changes it, I would be very grateful for that!