CSS3 resize Property


Example

Specify that a <div> element should be resizable by the user:

div {
    resize: both;
    overflow: auto;
}

Try it yourself »

More "Try it Yourself" examples below.


Definition and Usage

The resize property specifies whether or not an element is resizable by the user.

Note: The resize property applies to elements whose computed overflow value is something other than "visible".

Default value: none
Inherited: no
Animatable: no. Read about animatable
Version: CSS3
JavaScript syntax: object.style.resize="both" Try it

Browser Support

The numbers in the table specify the first browser version that fully supports the property.

Numbers followed by -moz- specify the first version that worked with a prefix.

Property
resize  4.0 Not supported 5.0
4.0 -moz-
4.0 15.0

CSS Syntax

resize: none|both|horizontal|vertical|initial|inherit;

Property Values

Value Description Play it
none Default value. The user cannot resize the element Play it »
both The user can adjust both the height and the width of the element Play it »
horizontal The user can adjust the width of the element Play it »
vertical The user can adjust the height of the element Play it »
initial Sets this property to its default value. Read about initial Play it »
inherit Inherits this property from its parent element. Read about inherit

Examples

More Examples

Example

Let the user resize only the height of a <div> element:

div {
    resize: vertical;
    overflow: auto;
}

Try it yourself »

Example

Let the user resize only the width of a <div> element:

div {
    resize: horizontal;
    overflow: auto;
}

Try it yourself »

Related Pages

CSS3 tutorial: CSS3 User Interface

HTML DOM reference: resize property



SHARE THIS PAGE

COLOR PICKER

colorpicker





Search w3schools.com:

Translate w3schools.com: