1
嗨,我有两个div。滚动时阻止内容div与重叠标题div的差异
<div id="header">
-- some random html content here --
</div>
<div id="content">
1
2
3
4
5
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
some long content that needs scrolling.
</div>
这是我的css。
#header {
vertical-align:middle;
position:fixed;
top:0ex;
width:800px;
height: 48px;
background-color: #FFFFFF;
z-index: 10;
}
#content {
text-align:center;
margin-left:auto;
margin-right:auto;
width: 800px;
margin-top: 24px;
}
- 我想窗口滚动条滚动仅主体内容。我想避免更改身体标记的CSS,因为我的部分是整个页面的子部分。
- 我不希望“内容”div覆盖/重叠“标题”div。 (头部应该保持固定并始终出现在顶部用户应该能够滚动身体的内容而不会覆盖/重叠头部
是的,我想的头保持固定和滚动条滚动只的内容。我我能够让标题保持固定,但是当我做的时候,主体的内容会重叠/覆盖标题,而我不想那样做。 –
梳理背景颜色:白色和Z - 索引在10位置修复问题,并给我我想要的东西 –