resize

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

Syntax

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

/* Global values */
resize: inherit;
resize: initial;
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).

resize does not apply to the following:

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

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

none | both | horizontal | vertical | block | inline

Examples

Disabling resizability of textareas

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

HTML

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

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

<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

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

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

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

Result

Specifications

Specification Status Comment
CSS Logical Properties and Values Level 1
The definition of 'resize' in that specification.
Editor's Draft Adds the values block and inline.
CSS Basic User Interface Module Level 3
The definition of 'resize' in that specification.
Recommendation Initial definition.

Browser compatibility

DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
resizeChrome Full support 1Edge Full support 79Firefox Full support 4IE No support NoOpera Full support 12.1Safari Full support 3WebView Android Full support 37Chrome Android Full support 18Firefox Android Full support 4Opera Android Full support 14Safari iOS Full support 1Samsung Internet Android Full support 1.0
Support on block level, replaced, table cell, or inline block elementsChrome Full support 4Edge Full support 79Firefox Full support 5
Notes
Full support 5
Notes
Notes resize doesn't have any effect on <iframe>. See bug 680823)
IE No support NoOpera Full support 15Safari Full support 4WebView Android Full support 37Chrome Android Full support 18Firefox Android Full support 5
Notes
Full support 5
Notes
Notes resize doesn't have any effect on <iframe>. See bug 680823)
Opera Android Full support 14Safari iOS Full support 3.2Samsung Internet Android Full support 1.0
Support for flow-relative values block and inlineChrome No support NoEdge No support NoFirefox Full support 63IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoFirefox Android Full support 63Opera Android No support NoSafari iOS No support NoSamsung Internet Android No support No

Legend

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

See also