这可能是我相当简单的东西,但我的表格中,我有一个input
的type = "password"
和button
的type = button
彼此相邻。在设法初始化所有东西之后,我决定将两个组件的高度设置为相同的高度以形式对齐组件
我预计结果看起来像这样。
当我用下面的代码。但是,当您运行下面的代码时,您会看到高度不同。
input[type="password"] {
float: left;
margin: 0px 0px 0px 2vw;
width: 150px;
height: 50px;
display: inline-block;
}
.form-ckbx {
display: inline-block;
width: 150px;
height: 50px;
}
<form>
<input type="password" class="form-inp" id="password" placeholder="Password">
<button type = "button" class = "form-ckbx" id = "check" title="Show Password">Some Text</button>
</form>
我怎么能解决这个问题?
注
我知道类似的问题,如this和this,但解决方案似乎是在这种情况下是无效的。
边框的答案是正确的。而当您将其更改为填充时,答案不再正确 – Dan
对不起,在我的移动电话上编辑此问题 –
您知道边界如此影响它吗? – Dan