The resize property lets users drag to change an element’s size. It is especially common on <textarea> fields and scrollable panels.
01
none
Default lock.
02
both
Any direction.
03
vertical
Height only.
04
horizontal
Width only.
05
overflow
Required pair.
06
textarea
Common use.
Fundamentals
Introduction
The resize property in CSS allows you to control if and how an element can be resized by the user.
This property is particularly useful for text areas and other elements where you want to provide users the ability to adjust the size according to their needs.
Definition and Usage
By default, most elements use resize: none. Textareas are a common exception in browser styles, often allowing vertical resizing out of the box.
For custom boxes, pair resize with a non-visible overflow value such as auto so the resize handle appears and scrollbars work when content overflows.
💡
Beginner Tip
If resizing does nothing, check overflow. resize does not work when overflow: visible.
Foundation
📝 Syntax
The syntax for the resize property is straightforward. It can be applied to any element that supports resizing.
syntax.css
element{resize:value;}
Basic Example
resize-textarea.css
textarea{resize:both;width:200px;height:100px;}
Syntax Rules
none is the default and disables user resizing.
both allows horizontal and vertical resizing.
horizontal and vertical limit the resize axis.
block and inline are logical-axis keywords.
Requires overflow other than visible on non-textarea elements.
Use min-width, max-width, and height limits to constrain growth.
Defaults
🎯 Default Value
The default value of the resize property is none, meaning the element cannot be resized by the user.
Cheat Sheet
⚡ Quick Reference
Question
Answer
Default value
none
Most flexible option
both
Overflow requirement
Not visible
Inherited
No
Animatable
No
Common use
Textareas, note panels, code editors
Reference
💎 Property Values
Value
Example
Description
none
resize: none;
The element is not resizable.
both
resize: both;
The element is resizable both horizontally and vertically.
horizontal
resize: horizontal;
The element is resizable only horizontally.
vertical
resize: vertical;
The element is resizable only vertically.
block
resize: block;
Resizable on the block axis. Equivalent to vertical in common horizontal layouts.
inline
resize: inline;
Resizable on the inline axis. Equivalent to horizontal in common horizontal layouts.
nonebothhorizontalverticalblockinline
Context
When Does resize Matter?
resize is the right tool when users need control over space:
Comment boxes — Let users expand a textarea while writing longer messages.
Dashboard panels — Allow vertical growth for widgets with variable content.
Dev tools UI — Resize console or preview panes horizontally.
Fixed layouts — Use resize: none when drag handles would break the design.
Always set sensible min-* and max-* sizes so users cannot break the layout.
Preview
👀 Live Preview
This textarea uses resize: both. Drag the corner grip to change its size.
Resize handle appears in the bottom-right corner on supporting browsers.
Hands-On
Examples Gallery
Start with the reference textarea, compare vertical vs none, try horizontal panels, and resize a div with overflow.
📝 Textarea Resizing
Control how form fields can be resized — matching the reference example.
Example 1 — Resizable Textarea (both)
In this example, we’ll allow a text area to be resized both horizontally and vertically.
resize-both.html
<style>textarea{resize:both;width:200px;height:100px;}</style><h1>Resizable Text Area</h1><textarea></textarea>
Use overflow: auto on custom containers so resizing is allowed.
overflow
3
User drags the handle
The browser updates width and height based on the allowed axes.
User input
=
★
Flexible UI
Users adjust space to fit their content without extra JavaScript.
Compatibility
Browser Compatibility
The resize property is supported in most modern browsers, including the latest versions of Chrome, Firefox, Safari, Edge, and Opera. However, it is always a good practice to test your website across different browsers to ensure compatibility.
✓ UI · Broad support
Reliable resize support
Chrome, Firefox, Safari, Edge, and Opera support resize on textareas and overflow elements.
97%Modern browser support
Google Chrome1+ · Desktop & Mobile
Full support
Mozilla Firefox4+ · Desktop
Full support
Apple Safari3+ · macOS & iOS
Full support
Microsoft Edge79+ · Chromium
Full support
Opera12.1+ · Modern versions
Full support
Testing tip
Mobile browsers may hide resize handles on textareas. Test forms on touch devices if resizing is important to your UX.
resize property97% supported
Bottom line:resize is widely supported for textareas and overflow containers in modern browsers.
Wrap Up
Conclusion
The resize property is a useful tool for web developers looking to provide a more flexible user experience.
By allowing users to resize elements like text areas, you can enhance the usability of your web applications. Experiment with the different values of this property to see how it can improve the interactivity of your site.
Use resize: vertical on comment fields in fixed-width forms
Set min-height and max-width to protect layout
Pair custom resizable boxes with overflow: auto
Use resize: none when drag handles break your design
Test textarea behavior on mobile and desktop
❌ Don’t
Expect resize to work with overflow: visible
Allow unlimited growth without max dimensions
Rely on resize for core layout structure
Forget that block and inline follow writing mode
Hide resize handles without giving users another way to see full content
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about resize
Use these points when making elements user-resizable.
5
Core concepts
★01
none Default
No drag handle.
Default
⚙02
both
Width + height.
Pattern
◉03
vertical
Forms common.
Use case
▦04
overflow
Required pair.
Companion
📏05
min/max
Limit growth.
Safety
❓ Frequently Asked Questions
resize controls whether users can drag to change an element's size and in which directions. It is commonly used on textareas and scrollable panels.
The default value is none, which means the element cannot be resized by the user.
resize only applies when overflow is not visible. Set overflow to auto, scroll, or hidden on the element. Textareas meet this requirement by default.
horizontal lets users resize along the inline axis. inline is a logical keyword with similar behavior in horizontal writing modes. For most layouts, horizontal is the familiar choice.
Yes. Use resize: none on the textarea to remove the drag handle while keeping the field editable.