开发者

Aligning a image in text

开发者 https://www.devze.com 2023-03-19 15:56 出处:网络
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:

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

精彩评论

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

关注公众号