我想在我的元素中垂直对齐输入。我的代码适用于跨度,但不适用于输入!什么原因?
CSS 代码:
.float {
display: table-cell;
vertical-align: middle;
text-align: center;
}
div {
display: table;
border: solid 1px blue;
height: 120px;
}
HTML代码:
<div class="col-sm-12 ">
<span class='float'>Float right</span>
</div>
<div class="col-sm-12 ">
<input class='float' id='btnReport' name='btnReport' type='button' value='report' />
</div>
最佳答案
代码应该是
<div class="float"> <input id='btnReport' name='btnReport' type='button' value='report' /> </div>
您可以查看下面的演示链接
关于html - 使用 bootstrap 3 垂直对齐输入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24691481/