2
http://codepen.io/anon/pen/oXGMQZ你如何適應div的寬度的多行文字?
我想使我的父div文本大小的每個跨度自動填充父div的寬度。
<div class="box">
<span class="fit">what</span>
<span class="fit">an</span>
<span class="fit">idea!</span>
</div>
.box{
width: 50%;
background: beige;
text-align: center;
}
.fit{
display: block;
}
由於每行的結果文本都具有不同的行長度,因此每行上的結果文本將具有唯一的字體大小。
http://fittextjs.com/ – Stickers
我絕對指望它需要JavaScript。只是還沒有找到正確的解決方案。 – mike
我也試過。不會削減它。 – mike