The resize property

The above box, a div with height and width each set to 100 pixels, can be resized by clicking and dragging its lower right corner. This is made possible by the CSS lines:

overflow: auto;
resize: both;

When someone clicks and drags the handle to resize the box, the height and width properties are set to pixel values in the style attribute of the element. It’s possible to watch this happening in the brower’s developer tools:

Screen clipping showing the width and height of an element after being set in a resize event.

Leave a Reply

Your email address will not be published.

Color scheme: