Is there a way via CSS to set the image height to the line-height?

后端 未结 2 1478
清歌不尽
清歌不尽 2020-12-06 16:15

I have an image that\'s inline with text. That image is 32x32. I\'m looking to have it auto size to the line height of where it\'s contained so it fits properly. Is

2条回答
  •  误落风尘
    2020-12-06 16:53

    Use img{height: 1em;} /* whatever your line height may be, it is affected by its font-size /*

    See this Updated Demo (Increase or decrease the font size to view the result.)

提交回复
热议问题