in English
文本截斷
用省略號截斷長字符串。
對於較長的內容,您可以添加一個.text-truncate
類以使用省略號截斷文本。需要display: inline-block
或display: block
。
這段文字很長,一旦顯示就會被截斷。
<!-- Block level -->
<div class="row">
<div class="col-2 text-truncate">
This text is quite long, and will be truncated once displayed.
</div>
</div>
<!-- Inline level -->
<span class="d-inline-block text-truncate" style="max-width: 150px;">
This text is quite long, and will be truncated once displayed.
</span>