Why are inline block elements misaligned?

后端 未结 2 2037
梦如初夏
梦如初夏 2020-12-21 02:02

\"Problem\"

Inside a div with vertical-align: top; I have two elements, an img<

相关标签:
2条回答
  • 2020-12-21 02:40

    vertical-align: top is to be added to each element

    DEMO http://jsfiddle.net/CaU59/1/

    0 讨论(0)
  • 2020-12-21 02:59

    You need to add vertical-align to the elements themselves, not their container. They are currently aligned baseline as you can see from the text lining up with the image.

    http://jsfiddle.net/CaU59/2/

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