排版
用于控制元素中的分词的工具。
¥Basic usage
¥Normal
使用 break-normal
仅在正常分词点添加换行符。
¥Use break-normal
to only add line breaks at normal word break points.
The longest word in any of the major English language dictionaries is pneumonoultramicroscopicsilicovolcanoconiosis, a word that refers to a lung disease contracted from the inhalation of very fine silica particles, specifically from a volcano; medically, it is the same as silicosis.
<p class="break-normal ...">...</p>
¥Break Words
如果需要,使用 break-words
在字中间添加换行符。
¥Use break-words
to add line breaks mid-word if needed.
The longest word in any of the major English language dictionaries is pneumonoultramicroscopicsilicovolcanoconiosis, a word that refers to a lung disease contracted from the inhalation of very fine silica particles, specifically from a volcano; medically, it is the same as silicosis.
<p class="break-words ...">...</p>
¥Break All
使用 break-all
在必要时添加换行符,而不是试图保留整个单词。
¥Use break-all
to add line breaks whenever necessary, without trying to preserve whole words.
The longest word in any of the major English language dictionaries is pneumonoultramicroscopicsilicovolcanoconiosis, a word that refers to a lung disease contracted from the inhalation of very fine silica particles, specifically from a volcano; medically, it is the same as silicosis.
<p class="break-all ...">...</p>
¥Break Keep
使用 break-keep
可防止换行符应用于中文/日文/韩文 (CJK) 文本。对于非 CJK 文本,break-keep
与 break-normal
具有相同的行为。
¥Use break-keep
to prevent line breaks from being applied to Chinese/Japanese/Korean (CJK) text. For non-CJK text break-keep
has the same behavior as break-normal
.
抗衡不屈不挠 (kànghéng bùqū bùnáo) 这是一个长词,意思是不畏强暴,奋勇抗争,坚定不移,永不放弃。这个词通常用来描述那些在面对困难和挑战时坚持自己信念的人, 他们克服一切困难,不屈不挠地追求自己的目标。无论遇到多大的挑战,他们都能够坚持到底,不放弃,最终获得胜利。
<p class="break-keep ...">...</p>
Tailwind lets you conditionally apply utility classes in different states using variant modifiers. For example, use hover:break-all
to only apply the break-all
utility on hover.
<p class="break-normal hover:break-all">
<!-- ... -->
</p>
For a complete list of all available state modifiers, check out the Hover, Focus, & Other States documentation.
You can also use variant modifiers to target media queries like responsive breakpoints, dark mode, prefers-reduced-motion, and more. For example, use md:break-all
to apply the break-all
utility at only medium screen sizes and above.
<p class="break-normal md:break-all">
<!-- ... -->
</p>
To learn more, check out the documentation on Responsive Design, Dark Mode and other media query modifiers.