resize CSS property

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

The resize CSS property sets whether an element is resizable, and if so, in which directions.

Try it

resize: both;
resize: horizontal;
resize: vertical;
resize: none;
<section class="default-example" id="default-example">
  <div id="example-element">Try resizing this element.</div>
</section>
#example-element {
  background: linear-gradient(135deg, cyan 0%, cyan 94%, white 95%);
  border: 3px solid #c5c5c5;
  overflow: auto;
  width: 250px;
  height: 250px;
  font-weight: bold;
  color: black;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

resize does not apply to the following:

  • Inline elements
  • Block elements for which the overflow property is set to visible or clip

Syntax

css
/* Keyword values */
resize: none;
resize: both;
resize: horizontal;
resize: vertical;
resize: block;
resize: inline;

/* Global values */
resize: inherit;
resize: initial;
resize: revert;
resize: revert-layer;
resize: unset;

The resize property is specified as a single keyword value from the list below.

Values

none

The element offers no user-controllable method for resizing it.

both

The element displays a mechanism for allowing the user to resize it, which may be resized both horizontally and vertically.

horizontal

The element displays a mechanism for allowing the user to resize it in the horizontal direction.

vertical

The element displays a mechanism for allowing the user to resize it in the vertical direction.

block

The element displays a mechanism for allowing the user to resize it in the block direction (either horizontally or vertically, depending on the writing-mode and direction value).

inline

The element displays a mechanism for allowing the user to resize it in the inline direction (either horizontally or vertically, depending on the writing-mode and direction value).

Formal definition

Initial valuenone
Applies toelements with overflow other than visible, and optionally replaced elements representing images or videos, and iframes
Inheritedno
Computed valueas specified
Animation typediscrete

Formal syntax

resize = 
none |
both |
horizontal |
vertical |
block |
inline

Examples

Disabling resizability of text areas

In many browsers, <textarea> elements are resizable by default. You may override this behavior with the resize property.

HTML

html
<textarea>Type some text here.</textarea>

CSS

css
textarea {
  resize: none; /* Disables resizability */
}

Result

Using resize with arbitrary elements

You can use the resize property to make any element resizable. In the example below, a resizable <div> contains a resizable paragraph (<p> element).

HTML

html
<div class="resizable">
  <p class="resizable">
    This paragraph is resizable in all directions, because the CSS `resize`
    property is set to `both` on this element.
  </p>
</div>

CSS

css
.resizable {
  resize: both;
  overflow: scroll;
  border: 1px solid black;
}

div {
  height: 300px;
  width: 300px;
}

p {
  height: 200px;
  width: 200px;
}

Result

Specifications

Specification
CSS Basic User Interface Module Level 4
# resize

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
resize
Chrome – Full support
Chrome 1 (Release date: 2008-12-11)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – Full support
Firefox 4 (Release date: 2011-03-22)
footnote Full support
Opera – Full support
Opera 12.1 (Release date: 2012-11-20)
footnote Full support
Safari – Full support
Safari 3 (Release date: 2007-10-26)
footnote Full support
Chrome Android – Full support
Chrome Android 18 (Release date: 2012-06-27)
footnote Full support
Firefox for Android – No support
Firefox for Android 4 – 68 (Release date: 2011-03-29)
footnote Removed in 79 and later
footnote The property is recognized, but has no effect. See bug 1776834.
Opera Android – Full support
Opera Android 14 (Release date: 2013-05-21)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote
footnote The property is recognized, but has no effect. See bug 211994.
Samsung Internet – Full support
Samsung Internet 1 (Release date: 2013-04-27)
footnote Full support
WebView Android – Full support
WebView Android 4.4 (Release date: 2013-12-09)
footnote Full support
WebView on iOS – No support
WebView on iOS
footnote
footnote The property is recognized, but has no effect. See bug 211994.
block
Chrome – Full support
Chrome 118 (Release date: 2023-10-10)
footnote Full support
Edge – Full support
Edge 118 (Release date: 2023-10-13)
footnote Full support
Firefox – Full support
Firefox 63 (Release date: 2018-10-23)
footnote Full support
Opera – Full support
Opera 104 (Release date: 2023-10-23)
footnote Full support
Safari – Full support
Safari 16 (Release date: 2022-09-12)
footnote Full support
Chrome Android – Full support
Chrome Android 118 (Release date: 2023-10-10)
footnote Full support
Firefox for Android – No support
Firefox for Android 63 – 68 (Release date: 2018-10-23)
footnote Removed in 79 and later
Opera Android – Full support
Opera Android 79 (Release date: 2023-12-06)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Full support
Samsung Internet 25 (Release date: 2024-04-24)
footnote Full support
WebView Android – Full support
WebView Android 118 (Release date: 2023-10-10)
footnote Full support
WebView on iOS – No support
WebView on iOS
footnote No support
Support on block level, replaced, table cell, or inline block elements
Chrome – Full support
Chrome 4 (Release date: 2010-01-25)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – Full support
Firefox 5 (Release date: 2011-06-21)
footnote
footnote resize doesn't have any effect on <iframe>. See bug 680823)
Opera – Full support
Opera 15 (Release date: 2013-07-02)
footnote Full support
Safari – Full support
Safari 4 (Release date: 2009-06-08)
footnote Full support
Chrome Android – Full support
Chrome Android 18 (Release date: 2012-06-27)
footnote Full support
Firefox for Android – No support
Firefox for Android 5 – 68 (Release date: 2011-06-21)
footnote Removed in 79 and later
Opera Android – Full support
Opera Android 14 (Release date: 2013-05-21)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Full support
Samsung Internet 1 (Release date: 2013-04-27)
footnote Full support
WebView Android – Full support
WebView Android 37 (Release date: 2014-09-03)
footnote Full support
WebView on iOS – No support
WebView on iOS
footnote No support
both
Chrome – Full support
Chrome 1 (Release date: 2008-12-11)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – Full support
Firefox 4 (Release date: 2011-03-22)
footnote Full support
Opera – Full support
Opera 15 (Release date: 2013-07-02)
footnote Full support
Safari – Full support
Safari 3 (Release date: 2007-10-26)
footnote Full support
Chrome Android – Full support
Chrome Android 18 (Release date: 2012-06-27)
footnote Full support
Firefox for Android – Full support
Firefox for Android 4 (Release date: 2011-03-29)
footnote Full support
Opera Android – Full support
Opera Android 14 (Release date: 2013-05-21)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Full support
Samsung Internet 1 (Release date: 2013-04-27)
footnote Full support
WebView Android – Full support
WebView Android 4.4 (Release date: 2013-12-09)
footnote Full support
WebView on iOS – No support
WebView on iOS
footnote No support
horizontal
Chrome – Full support
Chrome 1 (Release date: 2008-12-11)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – Full support
Firefox 4 (Release date: 2011-03-22)
footnote Full support
Opera – Full support
Opera 15 (Release date: 2013-07-02)
footnote Full support
Safari – Full support
Safari 3 (Release date: 2007-10-26)
footnote Full support
Chrome Android – Full support
Chrome Android 18 (Release date: 2012-06-27)
footnote Full support
Firefox for Android – Full support
Firefox for Android 4 (Release date: 2011-03-29)
footnote Full support
Opera Android – Full support
Opera Android 14 (Release date: 2013-05-21)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Full support
Samsung Internet 1 (Release date: 2013-04-27)
footnote Full support
WebView Android – Full support
WebView Android 4.4 (Release date: 2013-12-09)
footnote Full support
WebView on iOS – No support
WebView on iOS
footnote No support
inline
Chrome – Full support
Chrome 118 (Release date: 2023-10-10)
footnote Full support
Edge – Full support
Edge 118 (Release date: 2023-10-13)
footnote Full support
Firefox – Full support
Firefox 63 (Release date: 2018-10-23)
footnote Full support
Opera – Full support
Opera 104 (Release date: 2023-10-23)
footnote Full support
Safari – Full support
Safari 16 (Release date: 2022-09-12)
footnote Full support
Chrome Android – Full support
Chrome Android 118 (Release date: 2023-10-10)
footnote Full support
Firefox for Android – No support
Firefox for Android 63 – 68 (Release date: 2018-10-23)
footnote Removed in 79 and later
Opera Android – Full support
Opera Android 79 (Release date: 2023-12-06)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Full support
Samsung Internet 25 (Release date: 2024-04-24)
footnote Full support
WebView Android – Full support
WebView Android 118 (Release date: 2023-10-10)
footnote Full support
WebView on iOS – No support
WebView on iOS
footnote No support
none
Chrome – Full support
Chrome 1 (Release date: 2008-12-11)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – Full support
Firefox 4 (Release date: 2011-03-22)
footnote Full support
Opera – Full support
Opera 15 (Release date: 2013-07-02)
footnote Full support
Safari – Full support
Safari 3 (Release date: 2007-10-26)
footnote Full support
Chrome Android – Full support
Chrome Android 18 (Release date: 2012-06-27)
footnote Full support
Firefox for Android – Full support
Firefox for Android 4 (Release date: 2011-03-29)
footnote Full support
Opera Android – Full support
Opera Android 14 (Release date: 2013-05-21)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Full support
Samsung Internet 1 (Release date: 2013-04-27)
footnote Full support
WebView Android – Full support
WebView Android 4.4 (Release date: 2013-12-09)
footnote Full support
WebView on iOS – No support
WebView on iOS
footnote No support
vertical
Chrome – Full support
Chrome 1 (Release date: 2008-12-11)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – Full support
Firefox 4 (Release date: 2011-03-22)
footnote Full support
Opera – Full support
Opera 15 (Release date: 2013-07-02)
footnote Full support
Safari – Full support
Safari 3 (Release date: 2007-10-26)
footnote Full support
Chrome Android – Full support
Chrome Android 18 (Release date: 2012-06-27)
footnote Full support
Firefox for Android – Full support
Firefox for Android 4 (Release date: 2011-03-29)
footnote Full support
Opera Android – Full support
Opera Android 14 (Release date: 2013-05-21)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Full support
Samsung Internet 1 (Release date: 2013-04-27)
footnote Full support
WebView Android – Full support
WebView Android 4.4 (Release date: 2013-12-09)
footnote Full support
WebView on iOS – No support
WebView on iOS
footnote No support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
See implementation notes.

See also