[英]How to stretch a div from certain position to the bottom of the page?
我正在嘗試將div從其當前位置延伸到頁面末尾。 我該怎么辦? 這是我的代碼:
<div style="text-align:center; font-weight:bold; font-size:small; background-color:Silver; position:absolute; width:100%">Copyright © Aradmey<br /><%= GetDomain() %></div>
div不在頁面頂部,只是頁腳,而我無法使其正常工作。
當前,頁面看起來像這樣 。 我希望它看起來像這樣 ,但是如果沒有將其拉伸到最底端以使其可滾動。 我希望它只有在尚未觸及底部時才能伸展。
我會建議。
html,body{height: 100%;} .stretch{ height: 100%; display: table; width: 100%; } .stretch .left{ display: table-cell; width: 40%; background: #333; } .stretch .right{ display: table-cell; width: 60%; background: #ccc; }
<div class="stretch"> <div class="left"></div> <div class="right"></div> </div>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.