I have this code:
<li id="myLI">
<a id="myAnchor" href="#"&g开发者_Python百科t;
<img src="/icons/icon.png">Click Here</a>
</li>
I need to get the text to align in the middle of the icon (vertically), so I tried adding: vertical-align:middle but it's not working.
Can anyone advice please?
Thanks
#myLI a#myAnchor img{
float:left;
margin:margin to center;
}
Margin to center is the values that you need to give according to the center of the text. eg margin : 5px 5px 0px 2px;
精彩评论