Javascript examples for CSS Style Property:resize
The resize property sets whether or not an element is user resizable.
Value | Description |
---|---|
none | Default value. The user cannot resize the element |
both | can adjust both the height and the width of the element |
horizontal | can adjust the width of the element |
vertical | can adjust the height of the element |
initial | Sets this property to its default value. |
inherit | Inherits this property from its parent element. |
Item | Value |
---|---|
Default Value: | none |
Return Value: | A String, representing the resize property of an element |
CSS Version | CSS3 |
Make a <div> element resizable:
<!DOCTYPE html> <html> <head> <style> #myDIV {/*from ww w. j a v a 2 s . c o m*/ border: 1px solid black; background-color: lightblue; width: 270px; overflow: auto; } </style> </head> <body> <button onclick="myFunction()">Test</button> <div id="myDIV"> <p>resize this DIV element.</p> </div> <script> function myFunction() { document.getElementById("myDIV").style.resize = "both"; } </script> </body> </html>