1. 排版
  2. text-transform

排版

text-transform

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

样式
uppercase
text-transform: uppercase;
lowercase
text-transform: lowercase;
capitalize
text-transform: capitalize;
normal-case
text-transform: none;

示例(Examples)

大写文本(Uppercasing text)

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

🌐 Use the uppercase utility to uppercase the text of an element:

The quick brown fox jumps over the lazy dog.

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

小写文本(Lowercasing text)

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

🌐 Use the lowercase utility to lowercase the text of an element:

The quick brown fox jumps over the lazy dog.

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

大写文本(Capitalizing text)

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

🌐 Use the capitalize utility to capitalize text of an element:

The quick brown fox jumps over the lazy dog.

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

重置文本大小写(Resetting text casing)

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

🌐 Use the normal-case utility to preserve the original text casing of an element—typically used to reset capitalization at different breakpoints:

The quick brown fox jumps over the lazy dog.

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

响应式设计(Responsive design)

text-transform 工具前面使用断点变体如 md: 仅在 medium 屏幕尺寸及以上时应用工具:

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

请参阅 变体文档 详细了解如何使用变体。

TailwindCSS 中文网 - 粤ICP备13048890号