2017-04-06 67 views
0

我想讓列表從下往上擴展。它的工作原理,但如果名單太大,它會超過「頂級」分區。我的想法是,當列表太大時,我會讓滾動條和「底部」div有50%的「頂部」div。我無法做到最高:0,因爲如果我這樣做,div就會上升。與「底部」使用高度相同。我知道爲什麼現在不工作,但我沒有更多的想法如何解決它。任何想法都會有所幫助。從下往上擴展列表

https://plnkr.co/edit/0qZVy8PeZ6uUwejV1AFf?p=preview

.top { 
    position: relative; 
    height: 300px; 
    background-color:red; 
} 

.bottom { 
    position: absolute; 
    bottom:5px; 
    background-color:blue; 
} 

回答

0

我已經通過你提供的鏈接只是走了。這些屬性添加到.bottom

max-height:300px; 
overflow-y:auto; 
+0

這正是我需要的。非常感謝你 – Erad

+0

Np :) 剛剛投票並將其標記爲答案xD @Erad – hamzox

0

採取position: absolute;關閉.bottom,然後添加到overflow-y: scroll; .TOP