1. 字体
  2. text-transform

字体

文本转换

用于控制文本大小写的工具类。

ClassStyles
uppercase
text-transform: uppercase;
lowercase
text-transform: lowercase;
capitalize
text-transform: capitalize;
normal-case
text-transform: none;

示例

转换为大写

使用 uppercase 工具类将元素的文本转换为大写:

The quick brown fox jumps over the lazy dog.

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

转换为小写

使用 lowercase 工具类将元素的文本转换为小写:

The quick brown fox jumps over the lazy dog.

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

首字母大写

使用 capitalize 工具类将元素的文本首字母大写:

The quick brown fox jumps over the lazy dog.

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

重置文本大小写

使用 normal-case 工具类保持元素的原始文本大小写—通常用于在不同断点重置大小写:

The quick brown fox jumps over the lazy dog.

<p class="normal-case">The quick brown fox ...</p>

响应式设计

Prefix a text-transform utility with a breakpoint variant like md: to only apply the utility at medium screen sizes and above:

<p class="capitalize md:uppercase ...">  Lorem ipsum dolor sit amet...</p>

Learn more about using variants in the variants documentation.

Copyright © 2025 Tailwind Labs Inc.·Trademark Policy