布局
用于控制列或页面在元素内的拆分方式的工具。
¥Basic usage
¥Setting the break-inside behavior
使用 break-inside-*
工具来控制分栏符或分页符在元素中的行为方式。例如,使用 break-inside-avoid-column
工具避免元素内的分栏符。
¥Use the break-inside-*
utilities to control how a column or page break should behave within an element. For example, use the break-inside-avoid-column
utility to avoid a column break within an element.
<div class="columns-2">
<p>Well, let me tell you something, ...</p>
<p class="break-inside-avoid-column">Sure, go ahead, laugh...</p>
<p>Maybe we can live without...</p>
<p>Look. If you think this is...</p>
</div>
Tailwind lets you conditionally apply utility classes in different states using variant modifiers. For example, use hover:break-inside-avoid-column
to only apply the break-inside-avoid-column
utility on hover.
<div class="hover:break-inside-avoid-column">
<!-- ... -->
</div>
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-inside-avoid-column
to apply the break-inside-avoid-column
utility at only medium screen sizes and above.
<div class="md:break-inside-avoid-column">
<!-- ... -->
</div>
To learn more, check out the documentation on Responsive Design, Dark Mode and other media query modifiers.