我有一个带有 position: fixed
的侧边栏。在这个侧边栏中,我有一个 .list
,我想使用 overflow: scroll
。但是,它并没有按照我想要的方式工作。
HTML
<div id="side">
Stuff
<div id="list">
<div class="item">An item</div>
</div>
</div>
CSS
#side {
width: 20%;
height: 100%;
background-color: red;
position: fixed;
}
#list {
width: 100%;
background-color: yellow;
overflow: scroll;
}
.item {
padding: 10px;
}
问题的JSFiddle:http://jsfiddle.net/wGE9W/(黄色的list
无法滚动)