How can I center my nav bar, but still appear as a line in the top of the site? I know i must change something in the css file where li is built, but i can't figure it out. The code is:
<ul>
<li><a class="active" href="index.html">Home</a></li>
<li><a href="index.html">Tab 1</a></li>
<li><a href="index.html">Tab 2</a></li>
<li><a href="index.html">Tab 3</a></li>
<li><a href="index.html">Tab 4</a></li>
</ul>
And the css file is like:
ul {
display: inline-block;
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #333;
}
li {
float: left;
}
li a {
display: block;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
li a:hover:not(.active) {
background-color: #111;
}
.active {
background-color: #791519;
}
display in a horizontal row](http://stackoverflow.com/questions/885691/how-to-make-a-ul-display-in-a-horizontal-row)
– caramba Oct 16 '16 at 16:31