So I have a basic navigation list bar. However some of the items have two lines of text.
I'd like to vertical-align:middle the text, while still being able to hover and click in the list block.
HTML:
<div class="nav">
<ul>
<li><a href="/">Home</a></li>
<li><a href="/">Some Text</a></li>
<li><a href="/">Double<br>Line</a></li>
<li><a href="/">Something</a></li>
</ul>
</div>
CSS:
.nav li {
float: left;
}
.nav a {
background: #000;
display: block;
padding: 10px;
text-decoration: none;
border-right: 2px solid #fff;
font-size: 14px;
text-align: center;
color: #fff;
}
.nav a:hover {
background: yellow;
color: #000;
}
This probably explains it best: http://jsfiddle.net/ZmpXM/
Cheers