2017-04-06 63 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