我如何在父div的底部放置一个textarea并使textarea的宽度相同?父母div的底部有相同父宽度的位置固定元素
我现在面临的问题是textarea一直扩展到页面的右侧。
的Html
html,
body {
height: 90%;
}
.container {
position: relative;
margin-left: 100px;
width: 500px;
height: 100%;
border: 1px solid red;
}
.middle {
position: absolute;
top: 20px;
left: 20px;
width: 100%;
height: 100%;
border: 1px solid blue;
}
.bottom {
position: fixed;
bottom: 0;
width: 100%;
}
<div class="container">
<div class="middle">
<p>
Textarea should be placed at bottom of the 'blue' div, with the same width
</p>
<textarea class="bottom" placeholder="Textarea..."></textarea>
</div>
</div>
这里是我有问题的一个简单的例子:https://jsfiddle.net/hu45v46p/1/
怎么可以这样用HTML和CSS来解决?