在下面的例子中,我试图将数字居中。我希望轮廓保持原样,但文本要与中心对齐。我该怎么做?
#cat-flight-numbers {
border-top: 2px solid #000;
border-bottom: 2px solid #000;
float: right;
height: 30px;
display: flex;
align-content: stetch;
align-items: center;
}
#cat-flight-numbers .flight-number {
align-self: stretch;
padding: 0 10px;
border-right: 1px solid #000;
}
#cat-flight-numbers .flight-number:last-of-type {
border-right: none;
}
<div id="cat-flight-numbers" class="cat-flight-numbers text-md-right mt-2">
<span class="flight-number">5</span><span class="flight-number">4</span><span class="flight-number">0</span><span class="flight-number">3.<span class="decimal">5</span></span></div>