Automatically scale an image to match text height

后端 未结 1 2030
别跟我提以往
别跟我提以往 2021-01-01 12:41

I\'ve got an image which I want to use inline with some text, but I need it to match the text height. I know it\'s possible to something like

相关标签:
1条回答
  • 2021-01-01 13:13

    Did you try this giving the image height as 1em?

    img {height: 1em;}
    

    Check out the fiddle here: http://jsfiddle.net/yAr7z/

    0 讨论(0)
提交回复
热议问题