codelove codelove - 1 year ago 176
CSS Question

div resizable like text-area

Browsers allow text-areas to be re-sized by dragging their corner by default. I was wondering if this rule could be applied to other elements (a div for instance). I know this effect could be achieved using the jQuery

or the jQuery-ui
function, but I would like to do it with plain html / css if it is possible to avoid relying on that library. Are their any CSS rules that I could apply to a div to make it behave in this way?

If you have any other solution I would like to hear it.

Answer Source

Use the css3 resize property.

div {
    resize: both;

There is also a resize: horizontal and resize: vertical.

Not currently cross browser

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download