1. Typography
  2. text-transform

Typography

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 ...">  <!-- ... --></p>

Learn more about using variants in the variants documentation.

版权所有 © 2025 Tailwind Labs Inc.·商标政策