CSS resize Property

Beginner
⏱️ 5 min read
📚 Updated: Jun 2026
🎯 4 Examples
UI Controls

What You’ll Learn

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.

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.

📝 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.

🎯 Default Value

The default value of the resize property is none, meaning the element cannot be resized by the user.

⚡ Quick Reference

QuestionAnswer
Default valuenone
Most flexible optionboth
Overflow requirementNot visible
InheritedNo
AnimatableNo
Common useTextareas, note panels, code editors

💎 Property Values

ValueExampleDescription
noneresize: none;The element is not resizable.
bothresize: both;The element is resizable both horizontally and vertically.
horizontalresize: horizontal;The element is resizable only horizontally.
verticalresize: vertical;The element is resizable only vertically.
blockresize: block;Resizable on the block axis. Equivalent to vertical in common horizontal layouts.
inlineresize: inline;Resizable on the inline axis. Equivalent to horizontal in common horizontal layouts.
none both horizontal vertical block inline

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.

👀 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.

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>
Try It Yourself

How It Works

The browser draws a resize grip on the textarea. Users can drag it to change width and height freely within any min/max limits you set.

Example 2 — Vertical Resize Only

Use resize: vertical when width should stay fixed but users may need more lines of text.

resize-vertical.html
<style>
  textarea {
    resize: vertical;
    width: 100%;
  }
</style>
Try It Yourself

How It Works

Vertical resize is a common pattern for comment fields because it preserves column alignment in forms.

🔀 Panels & Containers

Apply resize to scrollable boxes beyond native textareas.

Example 3 — Horizontal Panel Resize

A note panel with resize: horizontal and overflow: auto lets users widen the box without changing height.

resize-horizontal.html
<style>
  .panel {
    resize: horizontal;
    overflow: auto;
    width: 240px;
    height: 120px;
  }
</style>
Try It Yourself

How It Works

Non-textarea elements need overflow set so the resize property can take effect.

Example 4 — Resizable Div with Overflow

Combine resize: both, overflow: auto, and min dimensions for a flexible notes box.

resize-div.html
<style>
  .box {
    resize: both;
    overflow: auto;
    min-width: 200px;
    min-height: 100px;
  }
</style>
Try It Yourself

How It Works

Min and max size properties prevent the user from shrinking or growing the panel beyond usable limits.

resize and overflow

resize works together with overflow. If overflow is visible, the resize handle will not appear on regular block elements.

Textareas handle overflow internally, which is why resize is so commonly demonstrated on them.

resize-with-overflow.css
.notes {
  resize: vertical;
  overflow: auto;
  min-height: 120px;
}

🧠 How resize Works

1

Set resize direction

Choose none, both, horizontal, or vertical.

resize
2

Enable overflow if needed

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.

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 Chrome 1+ · Desktop & Mobile
Full support
Mozilla Firefox 4+ · Desktop
Full support
Apple Safari 3+ · macOS & iOS
Full support
Microsoft Edge 79+ · Chromium
Full support
Opera 12.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 property 97% supported

Bottom line: resize is widely supported for textareas and overflow containers in modern browsers.

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.

💡 Best Practices

✅ Do

  • 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

Key Takeaways

Knowledge Unlocked

Five things to remember about resize

Use these points when making elements user-resizable.

5
Core concepts
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.

Practice in the Live Editor

Open the HTML editor and try resize: both on a textarea or scrollable panel.

HTML Editor →

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.

5 people found this page helpful