目前我解決以下問題的方法是使用JavaScript計算和調整額外空間。有更好的(CSS/HTML)'嗎?在頁面中間進行一些控制以消耗剩餘的Verticle空間的最佳方式是什麼?
我計算已用空間並減去可用空間。然後將控件的高度更改爲該值。很好用,但是有CSS解決方案嗎?
這一切更好地在這裏說明:http://jsfiddle.net/sdh38gxe/4/
<body>
<div id="mainDiv">
<div id="divForHeight">
<h1>Some title</h1>
<input type="text" placeholder="Some contols" />
<textarea>I want to expand this to have the maximum verticle space without introducing scrollbars</textarea>
<input type="text" placeholder="Some more contols" />
<button type="button">Save</button>
</div>
</div>
</body>
我意識到,我想答案不是這樣簡單,但我正在尋找的是一些CSS properity如height: consumeMaximumAvailableSpace;
或許如果我用div作爲表格?