我有一排未对齐的 div。每个 div 都显示为 inline-block,但有 2 行文本的那个与该行的其余部分不一致。
.stopHoriz {
display: inline-block;
border: 1px solid black;
width: 75px;
height: 75px;
text-align: center;
font-size: .8em;
}
.stopVertical {
margin-bottom: 3px;
border: 1px solid black;
width: 75px;
height: 75px;
text-align: center;
font-size: .8em;
}
<div style="padding-right: 30px; vertical-align:top">
<div class="stopHoriz">Amusement</div>
<div class="stopHoriz">State Park</div>
<div class="stopHoriz">Zoo</div>
<div class="stopHoriz">History</div>
<div class="stopHoriz">Marine Encounters</div>
<div class="stopHoriz">Onset</div>
<div class="stopHoriz">Museum</div>
<div class="stopHoriz">Beaches</div>
</div>