resize

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;
Try resizing this element.
#example-element {
  background: linear-gradient(135deg, #0ff 0%, #0ff 94%, #fff 95%);
  border: 3px solid #c5c5c5;
  overflow: auto;
  width: 250px;
  height: 250px;
  font-weight: bold;
  color: #000;
  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

CSS

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

Result