Ich möchte, dass die Schaltflächen aus meiner Navigationsleiste in der Mitte der Navigationsleiste angezeigt werden, aber ich kann sie nur scheinbar links oder rechts erscheinen lassen. Wie zentriere ich sie? Hier ist meine CSS-Code:Wie zentriere ich die Elemente aus meiner Navigationsleiste?
body{
background-color:#d9dbdd;
}
#nav {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #333;
top: 0;
width: 100%;
z-index: 999999;
position:fixed;
}
#nav li {
float: left;
}
#nav li a {
display: block;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
#nav li a:hover:not(.active) {
background-color: #111;
}
.active {
background-color: #007ed8;
}
Jsfiddle: https://jsfiddle.net/ctjhvz6u/