![](/img/trans.png)
[英]How can I dynamically update a div's max-height by just using the div above and the div below?
[英]How can I change a div's height dynamically?
我有一個<div id="right_side_bar">
和CSS:
#right_side_bar{
margin-top:38px;
width:272px;
margin-left:722px;
background-color:#FFF;
padding-bottom:20px;
overflow-y:scroll;
}
我在堆棧上看到了類似的問題,但我不知道如何使right_side_bar更改其高度,以使其始終占窗口的100%。 我希望將其修復,以使其不會隨頁面的其余部分一起滾動。 但是,如果div本身是可滾動的,則Gawker.com正是這樣做的。
這很簡單:
#right_side_bar {
position: fixed;
top: 38px;
bottom: 20px;
background-color: white;
overflow-y: scroll;
width: 272px;
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.