I'm trying to create a stylish navigation bar with borders on the sides only, not the top. My goal is to achieve a design like this: |______________| so that my links are nicely boxed off. However, despite my efforts as a beginner, I can't seem to get it right without bordering every single link.
<nav>
<div align="center">
<div id="navigation">
<ul>
<li><a href="/">Home</a></li>
<li><a href="/about">About</a></li>
<li><a href="/products">Products</a></li>
<li><a href="/news">News</a></li>
<li><a href="/careers">Careers</a></li>
<li><a href="contact us">Contact Us</a></li>
</ul>
</div><!--navigation-->
</nav>
Here's the CSS code snippet:
nav {
width: 100%;
margin:0 auto;
}
nav ul li {
width: 16.6%;
float: left;
border-bottom: 1px solid #A2A2A2;
list-style-type: none;
display: inline;
}
nav ul li a {
display: block;
width: 100%;
text-align: center;
padding-top: 8px;
padding-right: 8px;
padding-bottom: 8px;
padding-left: 8px;
color: #202020;
font-family: "Myriad Pro Light";
text-transform: uppercase;
text-decoration: none;
font-size: 12pt;
}
nav ul li a:hover {
color: #89ccca
}
nav ul{
width: 80%;
list-style: none;
margin: 0;
padding: 0;
}