CSS resize Property

Beginner
6 min read
Updated: Oct 2026
3 examples
Live preview

Definition and Usage

The resize property sets whether an element is user-resizable, and if so, in which directions. Browsers usually show a small drag handle (often at the corner).

The initial value is none. It does not apply to inline elements, or to blocks whose overflow is visible or clip. Set overflow to auto, scroll, or hidden first. Textareas already scroll, so they resize easily.

Limited availability.

Not deprecated. Standard-track CSS. MDN marks it Limited availability. Core keywords (none, both, horizontal, vertical) work in modern Chrome, Firefox, Safari, and Edge. block and inline are logical and newer. Internet Explorer has no support. Not a runtime API.

CSS Syntax

syntax.css
resize: none | both | horizontal | vertical | block | inline | initial | inherit;

Property Values

ValueDescriptionTry it
noneDefault. No user resize handleTry it
bothResize horizontally and verticallyTry it
horizontalResize only left–rightTry it
verticalResize only up–downTry it
blockResize in the block axis (follows writing mode)Try it
inlineResize in the inline axis (follows writing mode)Try it
initial / inheritReset to none, or take the parent valueTry it

How to Use resize

Make the box eligible, then choose the resize direction.

  1. Use a block box (or a form control like textarea), not an inline span.
  2. Set overflow to auto, scroll, or hidden (skip this for textarea — it already scrolls).
  3. Give a starting width / height so there is a clear size to drag from.
  4. Set resize to both, horizontal, vertical, or a logical keyword. Cap growth with max-width / max-height when needed.
PieceRequired?Role
Non-inline boxYesInline elements ignore resize
overflow ≠ visible/clipYes (for most boxes)Makes the element eligible for resize
Starting sizeRecommendedGives the user a clear box to drag
KeywordYesChooses none or which axes can grow

Live Preview

Drag the handle on the box (usually the bottom-right corner). Change resize and compare directions.

This box already has overflow: auto so resize can apply. Drag the corner handle.

Box
Drag my corner to resize. Change the keyword above and try again.

resize: both

CSS Examples

Each snippet focuses on resize. overflow and a starting size are only there so the handle works. Use Try It Yourself for a live editor.

Example 1 — Resize Both Ways

Let the user drag the box wider and taller.

CSS
<style>
  div {
    width: 180px;
    height: 80px;
    overflow: auto;
    resize: both;
    border: 1px solid #cbd5e1;
    padding: 8px;
  }
</style>

<div>Drag the corner to resize both ways.</div>
Try It Yourself

How It Works

  1. Set a starting size. Width and height give the box a clear shape.
  2. Unlock overflow. overflow: auto makes the block eligible for resize.
  3. Choose both. resize: both allows horizontal and vertical dragging.
  4. Use the handle. Drag the corner (browser UI) to grow or shrink the box.

Example 2 — Vertical Only

Useful for textareas and note panels that should grow in height only.

CSS
<style>
  textarea {
    width: 220px;
    height: 80px;
    resize: vertical;
  }
</style>

<textarea>Resize me up and down only.</textarea>
Try It Yourself

How It Works

  1. Start with a textarea. It is already a scroll container, so no extra overflow rule is required.
  2. Set resize to vertical. The handle only changes height.
  3. Width stays fixed. Horizontal dragging is blocked by this keyword.
  4. Common pattern. Many comment boxes use vertical resize so layout width stays stable.

Example 3 — Disable Resize

Remove the drag handle when the size must stay fixed.

CSS
<style>
  textarea {
    width: 220px;
    height: 80px;
    resize: none;
  }
</style>

<textarea>No drag handle on this field.</textarea>
Try It Yourself

How It Works

  1. Use the default keyword. resize: none is the initial value.
  2. Override browser defaults. Many UAs show a handle on textareas unless you set none.
  3. Size stays CSS-controlled. Users can still type; they just cannot drag the box.
  4. Pair with fixed height. Keep forms tidy in tight layouts.

Edge Cases & Pitfalls

If the handle never appears, check these first.

overflow

Needs overflow other than visible or clip

On a normal div, set overflow: auto (or scroll / hidden). With the default visible, resize is ignored.

inline

Inline elements cannot be resized

A span with display: inline will not show a handle. Use a block, inline-block, or flex/grid item box.

limits

Min/max size still apply

min-width, max-width, min-height, and max-height cap how far the user can drag.

logical

block / inline follow writing mode

These logical keywords depend on writing-mode and direction. Prefer them for multilingual layouts; use physical keywords for fixed left–right / up–down UI.

touch

Handles vary by browser and device

Desktop browsers usually show a corner grip. Touch UIs may offer weaker or no resize UX. Do not rely on resize as the only way to reach content.

Browser Support

resize is a browser CSS property for user-driven sizing. Node.js, Deno, and Bun do not apply it.

✓ Limited availability

resize

none, both, horizontal, and vertical work in modern Chrome, Firefox, Safari, and Edge. Internet Explorer has no support. block and inline are newer logical keywords.

88% Modern browser reach
Google Chrome All modern
Full support
Mozilla Firefox All modern
Full support
Apple Safari All modern
Full support
Microsoft Edge All modern
Full support
Opera Modern
Full support
Samsung Internet All modern
Full support
Internet Explorer No
No support
resize Limited &middot; no IE

Bottom line: Safe to teach for modern browsers with overflow set correctly. Skip IE. Prefer physical keywords for beginner demos; verify block/inline when needed. Not a runtime API.

Key Takeaways

  • Role: let users drag an element’s size in one or both directions.
  • Prerequisite: overflow must not be visible or clip (except controls that already scroll).
  • Directions: both, horizontal, vertical, plus logical block / inline.
  • Textareas: use none to remove the default handle, or vertical to keep width stable.

One line: set overflow first, then pick a resize keyword — without eligible overflow, the handle never appears.

Frequently Asked Questions

It controls whether users can drag to change an element's size and in which directions. Common uses are textareas and scrollable panels.
The initial value is none. The element is not user-resizable unless you change it.
resize does not apply when overflow is visible or clip, and it does not apply to inline elements. Set overflow to auto, scroll, or hidden on a block box first.
horizontal always resizes left–right. inline resizes in the inline axis, which follows writing-mode and direction. In horizontal English text they often feel the same.
Yes. Use resize: none on the textarea to remove the drag handle while keeping the field editable.
Core values work in modern Chrome, Firefox, Safari, and Edge. Internet Explorer has no support. MDN marks the property Limited availability. It is a browser CSS property, not a Node.js feature.

Next: right

Learn how the CSS right property offsets positioned elements from the right edge.

right tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful