[英]Fill remaining height of min-height, max-height parent
I'm have a container which is of height:我有一个高度的容器:
.contact__user-input {
max-height: 50vh;
min-height: 50vh;
overflow: scroll;
}
Inside of this container, as the last child, I have a textarea
.在这个容器内,作为最后一个孩子,我有一个
textarea
。 This element is supposed to fill the remaining height - how can I do so?这个元素应该填充剩余的高度 - 我该怎么做?
<div class="contact__user-input">
...
<textarea class="contact__textarea separator--small mt-4 w-100" placeholder="Sonstige Leistungen oder eine Nachricht an uns (optional)"></textarea>
</div>
Here you go:这里是 go:
As you keep adding the data it will keep appending it until it reaches height:50vh;
当您继续添加数据时,它会继续添加数据,直到达到
height:50vh;
then a scroll will be seen.然后会看到一个卷轴。
View it in full screen for the height variations.
全屏查看高度变化。
.contact__user-input { overflow: scroll; min-height: 50vh; max-height: 50vh; display: flex; }
<div class="contact__user-input">... <textarea class="contact__textarea separator--small mt-4 w-100" placeholder="Sonstige Leistungen oder eine Nachricht an uns (optional)"></textarea> </div>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.