.area1{
top: 0;
width: 100%;
position: fixed;
_position: absolute;
z-index: 999;
background-color: white;
}
.area2{
width: 100%;
position: relative;
top: 85px;
} area1固定,area2可滚动,且滚动至area1区域时内容被覆盖(将背景颜色去掉可共存);
本文介绍了一种使用CSS实现的页面布局方案,其中包括一个固定的顶部区域(area1)和一个可滚动的内容区域(area2)。当内容区域滚动到顶部区域时,为避免内容被覆盖,可以通过调整背景颜色等样式设置来实现两部分的共存。
.area1{
top: 0;
width: 100%;
position: fixed;
_position: absolute;
z-index: 999;
background-color: white;
}
.area2{
width: 100%;
position: relative;
top: 85px;
} 
被折叠的 条评论
为什么被折叠?