Typography

text-decoration-line

用於控制文字裝飾的通用類別。

ClassStyles
underline
text-decoration-line: underline;
overline
text-decoration-line: overline;
line-through
text-decoration-line: line-through;
no-underline
text-decoration-line: none;

範例(Examples)

加底線文字(Underling text)

使用 underline 通用類別為元素的文字加上底線:

The quick brown fox jumps over the lazy dog.

<p class="underline">The quick brown fox...</p>

加頂線文字(Adding an overline to text)

使用 overline 通用類別為元素的文字加上頂線:

The quick brown fox jumps over the lazy dog.

<p class="overline">The quick brown fox...</p>

加刪除線文字(Adding a line through text)

使用 line-through 通用類別為元素的文字加上刪除線:

The quick brown fox jumps over the lazy dog.

<p class="line-through">The quick brown fox...</p>

移除文字裝飾線(Removing a line from text)

使用 no-underline 通用類別移除元素的文字裝飾線:

The quick brown fox jumps over the lazy dog.

<p class="no-underline">The quick brown fox...</p>

在 hover 時套用(Applying on hover)

text-decoration-line 通用類別前面加上像 hover:* 這樣的變體,讓該通用類別只在該狀態下套用:

將滑鼠移到文字上以查看預期行為

The quick brown fox jumps over the lazy dog.
<p>The <a href="..." class="no-underline hover:underline ...">quick brown fox</a> jumps over the lazy dog.</p>

變體文件中了解更多關於使用變體的資訊。

響應式設計(Responsive design)

text-decoration-line 通用類別前面加上像 md: 這樣的中斷點變體,讓該通用類別只在中型螢幕尺寸及以上時套用:

<a class="no-underline md:underline ..." href="...">  <!-- ... --></a>

變體文件中了解更多關於使用變體的資訊。

Copyright © 2026 Tailwind Labs Inc.·商標政策(Brand)