I want to center perfectly the contents of my navigation bar but i can't. This is the code:
ul {
list-style-type: none;
padding: 0;
margin: 0;
overflow: hidden;
background-color: rgb(23, 5, 87);
position: -webkit-sticky;
position: sticky;
top: 0;
}
li {
float: left;
font-family: Verdana, Geneva, Tahoma, sans-serif;
margin: auto;
}
li a {
display: block;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
margin: auto;
}
li a:hover {
background-color: rgb(153, 255, 179);
color: black;
}
<ul>
<li style="float:left"><img src="images/huebo.png" width="28%" height="28%"></li>
<li><a style="center" href="4a.html">Prueba</a></li>
<li><a href="news.asp">News</a></li>
<li><a href="contact.asp">Contact</a></li>
<li><a href="about.asp">About</a></li>
<pl><a class="active" href="4a.html">≡</a></pl>
</ul>
I tried margin: auto; and display: inline; but didn't work.