div resizable like text-area

风流意气都作罢 提交于 2019-11-28 20:04:54
sachleen

Use the css3 resize property.

div {
    resize: both;
}

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


Not currently cross browser http://caniuse.com/#feat=css-resize

Eswar Rajesh Pinapala

You can do this using CSS3. You can create a user resizable div tag by setting the resize and overflow styles. I have set resize to both horizontal and vertical here:

.isResizable {
  background: rgba(255, 0, 0, 0.2);
  font-size: 2em;
  border: 1px solid black;
  overflow: hidden;
  resize: both;
  width: 160px;
  height: 120px;
  min-width: 120px;
  min-height: 90px;
  max-width: 400px;
  max-height: 300px;
}
<div class="isResizable">The quick brown fox jumps over the lazy dog.</div>
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!