排版
用于控制文本装饰样式的实用程序。
使用 decoration-*
实用程序来更改元素 text decoration 的样式。
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
<p class="underline decoration-solid ...">The quick brown fox...</p>
<p class="underline decoration-double ...">The quick brown fox...</p>
<p class="underline decoration-dotted ...">The quick brown fox...</p>
<p class="underline decoration-dashed ...">The quick brown fox...</p>
<p class="underline decoration-wavy ...">The quick brown fox...</p>
Tailwind 允许您使用变体修饰符有条件地在不同状态下应用实用程序类。例如,使用 hover:decoration-dashed
来仅 在 hover应用 decoration-dashed
.
<p class="underline hover:decoration-dashed">
<!-- ... -->
</p>
详细了解, 请参考 Hover, Focus, & Other States 文档.
您还可以使用变体修饰符来定位媒体查询,例如响应式断点、暗模式、首选减少运动等。例如, 使用 md:decoration-dashed
来应用 decoration-dashed
程序,适用于中等屏幕尺寸及以上。
<p class="underline md:decoration-dashed">
<!-- ... -->
</p>