Break Before 分隔前
用于控制元素前的列或页面应如何中断的实用程序。
| Class | Properties |
|---|
基本用法
设置中断前的行为
使用 break-before-{value} 实用程序来控制元素前的列或页面中断的行为。例如,使用 break-before-column 实用程序在元素前强制进行列中断。
html
<div class="columns-2">
<p>Well, let me tell you something, ...</p>
<p class="break-before-column">Sure, go ahead, laugh...</p>
<p>Maybe we can live without...</p>
<p>Look. If you think this is...</p>
</div>有条件地应用
悬停,焦点和其他状态
Tailwind 允许您使用变体修饰符在不同状态下有条件地应用实用程序类。例如,使用 hover:break-before-column 只在悬停时应用 break-before-column 实用程序。
html
<div class="hover:break-before-column">
<!-- ... -->
</div>要查看所有可用状态修饰符的完整列表,请查看悬停,焦点和其他状态文档。
断点和媒体查询
您还可以使用变体修饰符来定位媒体查询,如响应式断点、暗模式、偏好减少动作等。例如,使用 md:break-before-column 仅在中等屏幕尺寸及以上应用 break-before-column 实用程序。
html
<div class="md:break-before-column">
<!-- ... -->
</div>