所以我有這樣的HTML如何獲得兩個相鄰的跨度以垂直顯示其文本?
<div class="container">
<div class="jumbotron">
<div class="row">
<div class="col-xs-6"> <span class="currency-symbol">$</span><span class="price">44</span>
</div>
<div class="col-xs-6">
<p>/ month</p>
<p>Here are some really interesting things about the product.</p>
</div>
</div>
</div>
</div>
,然後這個CSS
.container {
width: 333px;
margin: 0 auto;
}
.currency-symbol {
vertical-align: top;
font-size: 33px;
}
.price {
font-size: 88px;
vertical-align: top; /* doesn't work */
}
的 '$' 符號對齊頂端一樣的RH列中的文本。但價格數額並沒有。
如何垂直對齊'$'符號,'44'數量和RH列中的文本,以便它們全部符合?
的jsfiddle這裏:http://jsfiddle.net/magician11/4k19w0fs/3/
感謝。
我不確定你在問什麼,數字'44'看起來不像它的頂部,因爲它的文字大小比其他東西大得多。你究竟想要它看起來如何? –
使用「.price」和「.currency-symbol」的'line-height'作一點點 - 使其小於字體大小。 –