
弹性盒 & 网格
用于控制弹性子项方向的工具。
使用 flex-row 将弹性项目沿与文本相同的方向水平排列:
🌐 Use flex-row to position flex items horizontally in the same direction as text:
<div class="flex flex-row ...">
<div>01</div>
<div>02</div>
<div>03</div>
</div>
使用 flex-row-reverse 将弹性项目沿相反方向水平排列:
🌐 Use flex-row-reverse to position flex items horizontally in the opposite direction:
<div class="flex flex-row-reverse ...">
<div>01</div>
<div>02</div>
<div>03</div>
</div>
使用 flex-col 垂直定位弹性项目:
🌐 Use flex-col to position flex items vertically:
<div class="flex flex-col ...">
<div>01</div>
<div>02</div>
<div>03</div>
</div>
使用 flex-col-reverse 将弹性项目垂直定位到相反方向:
🌐 Use flex-col-reverse to position flex items vertically in the opposite direction:
<div class="flex flex-col-reverse ...">
<div>01</div>
<div>02</div>
<div>03</div>
</div>
Tailwind 允许你使用变体修饰符在不同状态下有条件地应用工具类。例如,使用hover:flex-row 仅在 hover 时应用 flex-row 工具。
<div class="flex flex-col hover:flex-row">
<!-- ... -->
</div>
有关所有可用状态修饰符的完整列表,请查看悬停、聚焦、以及其他状态 文档。
你还可以使用变体修饰符来定位媒体查询,例如响应式断点、暗黑模式、首选减少运动等。例如,使用 md:flex-row 仅在中等屏幕尺寸及以上时应用 flex-row 工具。
<div class="flex flex-col md:flex-row">
<!-- ... -->
</div>