开发者

alignment issue with inline-blocks of different heights

开发者 https://www.devze.com 2023-03-28 18:11 出处:网络
I\'m trying to get the blocks pictured here to align with each other, but if they are different heights, for some reason开发者_如何学Python the shorter div aligns to the bottom of the container div. N

I'm trying to get the blocks pictured here to align with each other, but if they are different heights, for some reason开发者_如何学Python the shorter div aligns to the bottom of the container div. Neither div has any sort of padding or margin that would cause this behavior. What do I need to do to get them to align to the top of the div?

alignment issue with inline-blocks of different heights

alignment issue with inline-blocks of different heights


vertical-align:top on the elements that you want to be vertically aligned (not on the parent), as they are display:inline-block.

0

精彩评论

暂无评论...
验证码 换一张
取 消