Reputation: 193
How would I align my square image next to the menu text.
I tried
vertical-align: middle
but that doesn't seem to work.
Upvotes: 2
Views: 4477
Reputation: 51146
Just add vertical-align: middle;
to the IMG tag. Works for me.
<li class='active'>
<a href='#'>
<img src="http://upload.wikimedia.org/wikipedia/commons/5/55/Box_square.gif"
style="padding:10px; vertical-align: middle;" width="24" height="24">
<span>Menu1</span>
</a>
</li>
Also, the height and width attributes don't need "px" units.
Upvotes: 2
Reputation: 240868
You have to add vertical-align:middle
to the img
itself as opposed to the li
.
CSS
#cssmenu ul li img {
vertical-align: middle;
}
Working - jsFiddle here
Upvotes: 3