【发布时间】:2021-09-07 11:19:09
【问题描述】:
我遇到了这个问题,不确定解决方案。这 2 个输入的高度应该完全相同,但事实并非如此。在详尽地查看了类似的问题后,我确认这不是由于盒子大小。任何想法或帮助将不胜感激。
.updateInput select {
width: calc(24.5% - 4px);
min-height: 1.5em;
}
select {
width: 100%;
border: 1px solid #ccc;
border-radius: 10px;
background-color: white;
margin-top: 10px;
margin-bottom: 10px;
padding: 0.5em;
font-size: 16px;
font-family: Courier, Arial, Helvetica, sans-serif;
cursor: pointer;
line-height: 14px;
min-height: 1.5em;
}
*,
*:before,
*:after {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.updateInput input[type=date] {
width: calc(24.5% - 4px);
}
input[type=number],
input[type=date] {
width: 100%;
border: 1px solid #ccc;
border-radius: 10px;
background-color: white;
margin-top: 10px;
margin-bottom: 10px;
font-size: 16px;
font-family: Courier, Arial, Helvetica, sans-serif;
cursor: pointer;
line-height: 14px;
}
input {
font: inherit;
vertical-align: middle;
padding: 0.5rem;
margin: 0;
display: inline-block;
min-height: 1.5em;
}
*,
*:before,
*:after {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
<div id="saleUpdateInput" class="updateInput">
<form id="updateInputData">
<select>
<option selected>Select product</option>
</select>
<select>
<option selected>Select sale %</option>
</select>
<input type="date">
<input type=submit value="Update">
</form>
</div>
cmets 中要求的最小示例: https://jsfiddle.net/8qexLpa3/
【问题讨论】:
-
请提供您的问题的正确minimal reproducible example。
-
@CBroe 根据要求添加了示例????