How do I disable the resizable property of a textarea?
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
Introduction
Browsers allow users to resize many textarea elements by dragging the bottom-right handle. If you want to lock the control to a fixed size, the correct solution is CSS: set the resize property to none on the textarea.
Basic CSS Solution
The smallest working example is:
That removes the resize handle in modern browsers and keeps the element at the dimensions you assign.
Why resize Is the Right Property
The CSS resize property controls whether the user can drag to change the size of an element. For a textarea, the common values are:
- '
noneto disable resizing' - '
bothto allow horizontal and vertical resizing' - '
horizontalto allow only width changes' - '
verticalto allow only height changes'
If you only want to restrict one direction, use a partial setting instead of disabling resizing completely:
That is often a better user experience for multi-line input, because people can expand the field when they need more room without breaking the layout horizontally.
A Full Example
Here is a complete page showing a non-resizable textarea with overflow handling:
overflow: auto is useful here because if resizing is disabled and the content becomes longer than the visible area, the user still needs a way to scroll through the text.
Applying the Rule to All Textareas
If the requirement applies across the whole application, you can target every textarea:
That is simple, but use it carefully. In many forms, allowing vertical resize is actually helpful, especially for support tickets, comments, or long descriptions.
Accessibility and UX Considerations
Disabling resize is easy technically, but it is not always the best product decision. A fixed-height textarea can become frustrating for users entering long content, particularly on desktop where manual resizing is a useful affordance.
If your main concern is layout stability, consider one of these alternatives:
- allow only vertical resizing
- auto-grow the field with JavaScript
- keep the field fixed but provide enough height for expected content
A simple auto-grow implementation can be more user-friendly than removing resize entirely:
That approach is not a replacement for resize: none, but it shows that layout control and usability do not have to conflict.
Common Pitfalls
- Setting
resize: nonewithout making sure long content is still reachable through scrolling or another UX pattern. - Applying the rule globally to every
textareawhen only one field should be fixed. - Disabling resize for a long-form input where users would actually benefit from vertical expansion.
- Forgetting that
resizeonly affects manual dragging, not CSS or JavaScript size changes. - Locking the field size without testing the layout on desktop and mobile screen sizes.
Summary
- Disable manual resizing with
resize: none. - Set explicit width and height so the fixed size is intentional.
- Keep
overflow: autowhen hidden content still needs to be reachable. - Consider
resize: verticalif you want a better balance between layout control and usability. - Scope the CSS selector carefully so you do not disable resizing everywhere by accident.

