So I created a navigation bar using UL's and LI's. But I'm having trouble centering it with my webpage. Here's my code:
<style>
ul {
text-align: center;
list-style-type: none;
display: inline-block;
margin: 0;
padding: 0;
overflow: hidden;
background-color: rgb(111, 145, 156);
}
li {
float: left;
display:inline;
border-right:1px solid rgb(79, 100, 107);
}
li:last-child {
border-right: none;
}
li a {
display: block;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
li a:hover {
background-color: rgb(96, 35, 29);
}
li a:hover:not(.active) {
background-color: rgb(79, 100, 107);
}
.active {
background-color: rgb(127, 45, 37);
}
</style>
<ul class="nav">
<li><a href="{% url 'index' %}">Home</a></li>
<li><a class="active" href="{% url 'aboutus' %}">About us!</a></li>
<li><a href="{% url 'orderentry' %}">Order here!</a></li>
<li><a href="{% url 'shipmenttracking' %}">Track your shipment</a></li>
<li><a href="{% url 'ticketmanage' %}">Having trouble? Click here to get help!</a></li>
</ul>
You're probably thinking the issue is my li float: left;
But here's what it looks like when it's center
I'm at a loss. Any help is appreciated. Thanks.