我正在使用Angular4 +。以垂直方式调整div的大小
我想以编程方式垂直调整div的大小。我没有办法做到这一点。我不知道从哪里开始。以及如何实现它。我对使用jquery不感兴趣。任何想法或解决方案来实现这个使用角度的方式。
.textarea {
min-height: 150px;
border:1px solid #ddd;
padding:15px;
position:relative;
}
.textarea::before{
content: '';
position: absolute;
bottom: 0;
margin-left: -15px;
cursor: s-resize;
height: 9px;
width: 100%;
border-top: 1px solid #f1f1f1;
overflow: hidden;
background-color: #eff0f1;
background-image: url('https://cdn.sstatic.net/Sites/stackoverflow/img/sprites.svg');
background-image: url('https://cdn.sstatic.net/Sites/stackoverflow/img/sprites.svg'),none;
background-position: 210px -364px;
background-size: initial;
background-repeat: no-repeat;
}
<div class="textarea"contenteditable="true">
this is a text area
</div>
一个stackblitz https://stackblitz.com/edit/angular-text-resizable
任何想法来设置高度?我很困惑。 –
我认为这是值得你阅读文档,并熟悉一点点https://angular.io/docs/ – Everest
看看HTML的内部'textarea',应该让你到一个好地方,而不是试图创建你自己的。 https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea – Everest