Interactivity

resize

用於控制元素如何調整大小的通用類別。

ClassStyles
resize-none
resize: none;
resize
resize: both;
resize-y
resize: vertical;
resize-x
resize: horizontal;

範例(Examples)

在所有方向調整大小(Resizing in all directions)

使用 resize 使元素可以水平和垂直調整大小:

拖曳示範中的文字區域控制柄以查看預期行為

<textarea class="resize rounded-md ..."></textarea>

垂直調整大小(Resizing vertically)

使用 resize-y 使元素可以垂直調整大小:

拖曳示範中的文字區域控制柄以查看預期行為

<textarea class="resize-y rounded-md ..."></textarea>

水平調整大小(Resizing horizontally)

使用 resize-x 使元素可以水平調整大小:

拖曳示範中的文字區域控制柄以查看預期行為

<textarea class="resize-x rounded-md ..."></textarea>

防止調整大小(Prevent resizing)

使用 resize-none 來防止元素被調整大小:

注意文字區域控制柄已消失

<textarea class="resize-none rounded-md"></textarea>

響應式設計(Responsive design)

resize 通用類別前面加上像 md: 這樣的中斷點變體,讓該通用類別只在中型螢幕尺寸及以上時套用:

<div class="resize-none md:resize ...">  <!-- ... --></div>

變體文件中了解更多關於使用變體的資訊。

Copyright © 2026 Tailwind Labs Inc.·商標政策(Brand)