同一个div下两个input不对齐?

Dome如下https://jsfiddle.net/y4okbek1/11/
遇到过文字与图片不在一行的情况,
但是两个input不在一起还是第一次见,话说两个基线应该是一样的,为什么还会出现这种情况?

阅读 9.2k
4 个回答

给button加个文字。

vertical-align:baseline
Align the baseline of the box with the baseline of the parent box. If the box doesn't have a baseline, align the bottom of the box with the parent's baseline.

所以说button里面没有文字的话他就会把元素底部和父元素的baseline对齐啦(:3」∠)

input {
    float: left;
}

图片描述

跟type有关系

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题