简体   繁体   中英

Align Text to the bottom of a line with an image in HTML

Hi i have HTML with an Inline-Image like this

<p style="">
    <img src="df9b4006-930e-45d7-8123-bec019a37800.png" height="178" width="112">text
</p>

but the text is vertical-centered to the image, how can i position it on the bottom-base-line of the image in the same line?

在此输入图像描述

p img {vertical-align: baseline;}

以下是有关vertical-align的信息: https//developer.mozilla.org/en-US/docs/Web/CSS/vertical-align

I would use vertical-align and text-bottom for your example:

p img {
   vertical-align: text-bottom;
}

http://jsfiddle.net/crazytonyi/pSKYm/2/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM