I'm using icon fonts in a nav
list and I want to place text between two of the icons. However, there's an issue with alignment - the icons are positioned higher than the text, causing them to not match up well. Is there a solution to this problem by wrapping the text in a span
? I've tried adjusting various parameters but haven't found a satisfactory solution yet:
HTML:
<nav class="nav">
<ul>
<li><span data-icon=""></span><h2>HOME</h2></li>
<li><p>ICON FONT FTW</p></li>
<li><span data-icon=""></span><h2>ABOUT</h2></li>
<li><span data-icon=""></span><h2>CONTACT</h2></li>
</ul>
</nav>
CSS:
nav {
font-size: 1.2em;
background: gray;
text-align: center;
}
nav li:first-child {
display: inline-block;
}
nav li {
display: inline-block;
}