不同高度的内联块的对齐问题
我试图让此处所示的块彼此对齐,但如果它们的高度不同,由于某种原因,较短的 div 会与容器 div 的底部对齐。这两个 div 都没有任何会导致此行为的填充或边距。我需要做什么才能让它们与 div 顶部对齐?
I'm trying to get the blocks pictured here to align with each other, but if they are different heights, for some reason 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
vertical-align:top
在您想要垂直对齐的元素上(而不是在父元素上),因为它们是display:inline-block
。vertical-align:top
on the elements that you want to be vertically aligned (not on the parent), as they aredisplay:inline-block
.