html - Image max size according to parent's line-height -


is possible pure css make inline image size (scale) according line-height of parent?

consider set-up:

html:

<p>   <img src="image.png"/> text text text </p> 

css:

p {   line-height: 16px; }  img {   display: inline;   vertical-align: middle; } 

what image gets scaled height of 16px, line-height of paragraph. possible?

please note: i'm open changes in html , css, i'm not after js solution.

there's no pure html/css way this, sadly.


Comments