开发者

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:

Aligning a image in text

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜