Aligning a image in text
When putting a <img>
in text, it seems to want the bottom of the image to be at the text baseline, or a little above, example:
How can I have it so the image's center is at the te开发者_如何转开发xt's center? I know it can be done with CSS, however I forgot how.
Using vertical-align: middle
. E.g. http://jsfiddle.net/8QzFV/
Can you add padding to the top of the image?
#myImage
{
padding-top:6px;
}
just wrapp a div around it and use css style vertical-align:middle
精彩评论