Many have attempted to resolve this issue, creating makeshift solutions or simply settling for an outcome that just "gets by." But what is the optimal approach? I have nearly finished something, yet for some reason, the logo isn't centered, rather the entire unordered list (ul) is misaligned. This is the current output I am experiencing.
However, when the text lengths are equal, this is how the result appears:
Below is my HTML structure:
<div class="navbar">
<ul>
<li>
<a class="navbarLinks" href="#">Big Text Here</a>
</li>
<li>
<a class="navbarLogo" href="/"><img src="images/logo.png" width="100"></a>
</li>
<li>
<a class="navbarLinks" href="#">Small Text</a>
</li>
</ul>
<div class="divider"></div>
</div>
And my CSS styling:
.navbar
{
margin:0 auto;
text-align: center;
z-index: 9999;
margin-top: 10px;
}
.navbar ul
{
display: inline-block;
list-style-type: none;
margin:0 auto;
padding: 0px;
}
.navbar li
{
display: inline-block;
list-style-type: none;
vertical-align: middle;
}
.navbarLinks
{
color:#ccc;
margin: 20px;
text-align:center;
display:block;
text-shadow: -1px 0 #000, 0 1px #000, 1px 0 #000, 0 -1px #000;
text-decoration: none;
font-family: arial;
font-size: 20pt;
font-weight: bold;
}
.navbarLinks:hover
{
color:#fff;
}
.navbarLogo
{
padding-bottom: 0px;
text-align: center;
}
How should I rectify this coding issue?