-
input 设置左浮动 (float:left)。
取消input 默认的2px边框 和上下1px内边距
设置1px的边框
设置高
-
button设置高度比input的高度大2px
input { /* 直接设置1px边框覆盖 */ border: 1px solid red; /* 取消默认的上下1px内边距 */ padding: 0; height: 60px; float: left; } button, .sub, .sub1 { height: 62px; } <input type="text" name="" id=""> <button>按钮</button> <input type="submit" class="sub"> <input type="reset" class="sub1"> 按钮: <button>按钮</button> <input type="submit"> <input type="reset">
文本框和按钮不对齐现象(高度得设置一样)
最新推荐文章于 2023-02-08 16:31:23 发布