So I had a search online for a nav bar I could use, and upon finding one I added it to the webpage that I'm making
CSS:
ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
}
li {
float: left;
}
a:link, a:visited {
display: block;
width: 120px;
font-weight: bold;
color: #FFFFFF;
background-color: #98bf21;
text-align: center;
padding: 4px;
text-decoration: none;
text-transform: uppercase;
}
a:hover, a:active {
background-color: #7A991A;
}
HTML:
<ul>
<li><a href="#home">Home</a></li>
<li><a href="#news">News</a></li>
<li><a href="#contact">Contact</a></li>
<li><a href="#about">About</a></li>
</ul>
Anyway, how would I go about centering this to the middle of the page?
When I checked other questions it said the problem was something to do with float: left, but when I tried to replace it with the recommened alternative display:inline-block; it would vertically align the boxes
Any help is appreciated ^^