My inline-block elements are not lining up properly

后端 未结 5 724
醉话见心
醉话见心 2020-11-21 11:29

All of the elements within .track-container should line up nice and in line, each side by side, constrained by the 200px height they\'ve been given with no weir

5条回答
  •  梦谈多话
    2020-11-21 12:27

    10.8 Line height calculations: the 'line-height' and 'vertical-align' properties

    The baseline of an 'inline-block' is the baseline of its last line box in the normal flow, unless it has either no in-flow line boxes or if its 'overflow' property has a computed value other than 'visible', in which case the baseline is the bottom margin edge.

    This is a common issue involving inline-block elements. In this case, the default value of the vertical-align property is baseline. If you change the value to top, it will behave as expected.

    Updated Example

    .position-data {
        vertical-align: top;
    }
    

提交回复
热议问题