Interactivity
用于控制元素可缩放方式的工具类。
| Class | Styles |
|---|---|
resize-none | resize: none; |
resize | resize: both; |
resize-y | resize: vertical; |
resize-x | resize: horizontal; |
使用 resize 让元素同时可以横向和纵向缩放:
Drag the textarea handle in the demo to see the expected behavior
<textarea class="resize rounded-md ..."></textarea>使用 resize-y 让元素只能进行纵向缩放:
Drag the textarea handle in the demo to see the expected behavior
<textarea class="resize-y rounded-md ..."></textarea>使用 resize-x 让元素只能进行横向缩放:
Drag the textarea handle in the demo to see the expected behavior
<textarea class="resize-x rounded-md ..."></textarea>使用 resize-none 来禁止元素缩放:
Notice that the textarea handle is gone
<textarea class="resize-none rounded-md"></textarea>Prefix a resize utility with a breakpoint variant like md: to only apply the utility at medium screen sizes and above:
<div class="resize-none md:resize ..."> <!-- ... --></div>Learn more about using variants in the variants documentation.