css解决方案之- 模拟textarea高度自适应
css解决方案之--- 模拟textarea高度自适应
本文来自zhangxinxu的博客:《div模拟textarea文本域轻松实现高度自适应》
个人做积累学习用,感谢作者!
首先,我也去web.qq.com调研了一下:
<div id="content" contenteditable="true"></div>
下面就是css:
min-height:140px; _height:140px; //for ie6 word-wrap:break-word; width:300px;
扩展阅读:
http://zhangyaochun.iteye.com/blog/1473513 《html5之contenteditable属性》
http://zhangyaochun.iteye.com/blog/1268463 《css3之word-wrap》