resize
Quick Summary for resize
The resize CSS property sets whether an element is resizable, and if so, in which directions.
Code Usage for resize
/* Keyword values */ resize: none; resize: both; resize: horizontal; resize: vertical; resize: block; resize: inline;  /* Global values */ resize: inherit; resize: initial; resize: revert; resize: unset; 
More Details for resize

resize

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

resize does not apply to the following:

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

Syntax

/* Keyword values */ resize: none; resize: both; resize: horizontal; resize: vertical; resize: block; resize: inline;  /* Global values */ resize: inherit; resize: initial; resize: revert; 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

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
CSS Basic User Interface Module Level 4 # resize

See also

<textarea>

Last modified: Aug 12, 2021, by MDN contributors

Select your preferred language English (US)DeutschEspañolFrançais日本語中文 (简体) Change language

No Items Found.

Add Comment
Type in a Nick Name here
 
Other Categories in CSS
css
Search CSS
Search CSS by entering your search text above.
Welcome

This is my test area for webdev. I keep a collection of code here, mostly for my reference. Also if i find a good link, i usually add it here and then forget about it. more...

Subscribe to weekly updates about things i have added to the site or thought interesting during the last week.

You could also follow me on twitter or not... does anyone even use twitter anymore?

If you found something useful or like my work, you can buy me a coffee here. Mmm Coffee. ☕

❤️👩‍💻🎮

🪦 2000 - 16 Oct 2022 - Boots
Random Quote
The problem with hoarding is you end up living off your reserves. Eventually, you’ll become stale. If you give away everything you have, you are left with nothing. This forces you to look, to be aware, to replenish. . . . Somehow the more you give away, the more comes back to you.
Paul Arden
Random CSS Property

scrollbar-width

The scrollbar-width property allows the author to set the maximum thickness of an element's scrollbars when they are shown.
scrollbar-width css reference