<分区>
<分区>
我试图在 div 上放置一个 textarea 扩展器,但我找不到要设置的正确元素,这里是对我正在尝试做的事情的解释:
在底 Angular 的文本区域输入标签中,有扩展器供用户设置他想要的文本区域的大小
我的问题是,有没有办法把类似的东西放在 div 上?我不寻找 javascript 代码,css 或 html 会很棒。
最佳答案
使用 CSS3 resize: both;
,如下所示:http://dhtmlexamples.com/2011/01/20/creating-a-user-resizable-div-tag-using-css3/
<style type="text/css">
.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;
}
</style>
<div class="isResizable">The quick brown fox jumps over the lazy dog.</div>
关于html - css div 高度扩展器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7573593/