space between an inline-block element and a block element

前端 未结 2 1589
独厮守ぢ
独厮守ぢ 2021-01-26 10:33

What is that space between these two divs? I even removed the white space in html.

2条回答
  •  感动是毒
    2021-01-26 10:43

    Where that space is coming from?

    From the inline-block element being aligned to the baseline of the “line” it is displayed on.

    Add vertical-align:bottom (or text-bottom, or middle, ortop, …) to it, and the space will be gone: http://jsfiddle.net/9thpuvwa/2/

提交回复
热议问题