resize style property
Specifies or retrieves whether an element is resizable and if so, along which axis.
Syntax:
You can find the related objects in the Supported by objects section below.
This property is read/write.
CSS page for this property: resize |
Possible values:
The type of this property is string.
One of the following values:
Allow to adjust the height and the width of the element. | |||||||
Allow to adjust only the width of the element. | |||||||
Takes the value of this property from the computed style of the parent element. | |||||||
Resizing is not allowed for the user. | |||||||
Allow to adjust only the height of the element. |
Default: none.
Example HTML code 1:
This example illustrates the use of the resize property:
|
||||
<head> <style> .example { background: red; width: 200px; height: 100px; resize: both; overflow: scroll; } </style> </head> <body> <div class="example">Resize this division!</div> </body> |
||||
|
||||
Did you find this example helpful?
|
Example HTML code 2:
This example illustrates the use of the resize property in JavaScript:
|
||||
<head> <script type="text/javascript"> function ChangeResize (selectTag) { // Returns the index of the selected option var whichSelected = selectTag.selectedIndex; // Returns the text of the selected option var richValue = selectTag.options[whichSelected].text; var div = document.getElementById ("myDiv"); if ('resize' in div.style) { div.style.resize = richValue; } else { alert ("Your browser doesn't support this example!"); } } </script> </head> <body> <div id="myDiv" style="background: red; width: 200px; height100px; resize: both; overflow: scroll;">Resize this division</div> <select onchange="ChangeResize (this);" size="4"> <option selected="selected" />both <option />none <option />horizontal <option />vertical </select> </body> |
||||
|
||||
Did you find this example helpful?
|
Supported by objects:
CSSStyleDeclaration, htmlElement.style
External links:
User Contributed Comments