我有一个具有其他三个内联 div 的 div。我想将这三个 div 垂直对齐在中间。花几个小时试图理解为什么垂直对齐:中间;不工作以及如何解决问题。任何建议如何解决这个问题?
<div id="result-table">
<div class="row-item">
<div class="cell1">do not align vertically at middle</div>
<div class="cell2">this one too</div>
<div class="cell3">
test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test
</div>
</div>
#result-table {
display: block;
}
.row-item {
display: block;
vertical-align: middle;
width: 100%;
background-color: rgb(245, 245, 245);
border: 1px solid rgb(204, 204, 204);
border-radius: 4px 4px 4px 4px;
margin-bottom: 5px;
}
.cell1 {
display: inline-block;
padding-left: 20px;
width: 150px;
}
.cell2 {
display: inline-block;
width: 150px;
}
.cell3 {
display: inline-block;
width: 150px;
padding-right: 20px;
}