我正在尝试将此按钮垂直对齐模式页脚 div
的中心。这是我的 JSFiddle 的链接: https ://jsfiddle.net/kris_redden/34jyLpok/
.modal-footer {
background-color: #2A3E5D;
color: white;
height: 100px;
padding: 2px 16px;
}
.wrapper-div {
vertical-align: middle
}
.button {
background: #e8e8e8;
display: inline-block;
font-size: 12px position: relative;
}
<div class="modal-footer">
<div class="wrapper-div">
<button type="button" class="button"> Submit Filters </button>
</div>
</div>
我不确定需要更改什么才能使其在蓝色模态页脚 div 的中心垂直对齐。我知道可以通过在按钮上设置边距来以一种骇人听闻的方式完成此操作,但这不是我想要做的。
原文由 SQL and Java Learner 发布,翻译遵循 CC BY-SA 4.0 许可协议
去做这样的事情。这是 小提琴。