css : image-text alignment problem
could anyone provide me a solution to align this correctly http://jsfiddle.net/zEM7J/3/ so t开发者_StackOverflow社区hat the text appears in the middle of the image. right now its kind of in the bottom
Thanks
This works
<img src="" style="vertical-align:middle;">
http://jsfiddle.net/zEM7J/8/
HTML:
<div id="a" style="background: url("")>axasxasx</div>
CSS:
#a
{
background: #color url("path to image") center center no-repeat;
text-align:center;
}
If I understand your question correctly, you need to change the CSS to:
#a img
{
vertical-align: middle;
}
This will cause the text to be aligned vertically with the middle of the image.
精彩评论