Skip to main content Skip to docs navigation
View on GitHub

文字截斷 (Text truncation)

使用刪節號截斷較長的字串。

對於較長的內容,可以添加 .text-truncate 類別,以透過刪節號截斷文字。需為 display: inline-block 或是 display: block

Praeterea iter est quasdam res quas ex communi.
Praeterea iter est quasdam res quas ex communi.
<!-- Block level -->
<div class="row">
  <div class="col-2 text-truncate">
    Praeterea iter est quasdam res quas ex communi.
  </div>
</div>

<!-- Inline level -->
<span class="d-inline-block text-truncate" style="max-width: 150px;">
  Praeterea iter est quasdam res quas ex communi.
</span>