Dynamically Resize a DIV or Other HTML Element

Resize a DIV using CSS. The following CSS adds a resize grip similar to a textarea which allows the size of the div to be changed by the user.

<style>
#resize {
	resize:horizontal;
	overflow:auto;
	border:1px silver solid;
	width:320px;
	margin:0 auto;
}
</style>

Example:

Using the CSS above, the following HTML div can be resized. Note, the size is set to 320px which is the smallest cellphone size. Expand the div out or in to see the content resized within the div.

HTML
<div id="resize">
asdf asdf asdf asdf asdf asdf asdfasdf asdf asdf asdf asdf asdf asdfasdf asdf asdf asdf asdf asdf asdfasdf asdf asdf asdf asdf asdf asdfasdf asdf asdf asdf asdf asdf asdfasdf asdf asdf asdf asdf asdf asdfasdf asdf asdf asdf asdf asdf asdfasdf asdf asdf asdf asdf asdf asdfasdf asdf asdf asdf asdf asdf asdfasdf asdf asdf asdf asdf asdf asdfasdf asdf asdf asdf asdf asdf asdfasdf asdf asdf asdf asdf asdf asdf
</div>

Produces the result: 
 

asdf asdf asdf asdf asdf asdf asdfasdf asdf asdf asdf asdf asdf asdfasdf asdf asdf asdf asdf asdf asdfasdf asdf asdf asdf asdf asdf asdfasdf asdf asdf asdf asdf asdf asdfasdf asdf asdf asdf asdf asdf asdfasdf asdf asdf asdf asdf asdf asdfasdf asdf asdf asdf asdf asdf asdfasdf asdf asdf asdf asdf asdf asdfasdf asdf asdf asdf asdf asdf asdfasdf asdf asdf asdf asdf asdf asdfasdf asdf asdf asdf asdf asdf asdf