我希望在一个具有overflow-y:scroll属性的div内部拥有一个固定位置的div,也就是说,我希望这个div保持原地,而其他内容正常滚动。
但是我无法找出问题所在,有人可以帮忙吗?提前谢谢...
.foo {
position:relative;
display:block;
width:100%;
height:300px;
overflow-y:scroll;
}
.bar {
position:fixed;
top:0;
right:0;
}
这里是HTML代码
<div class="foo">
<div class="bar"><div><!-- end of div that should be fixed -->
<div class="someOther">...</div>
<div class="someOther">...</div>
<div class="someOther">...</div>
<div class="someOther">...</div>
</div><!-- end of container -->