gpt4 book ai didi

html - 只滚动内容div,其他的应该是固定的

转载 作者:技术小花猫 更新时间:2023-10-29 12:10:14 26 4
gpt4 key购买 nike

我有三个 div。我需要固定 header 和 left_side div 并滚动内容 div。我一直在寻找解决方案,并找到了具有溢出位置 的内容。但是我不能正确地使用它。我怎样才能做到这一点?我将感谢每一种答案。

Picture

body {   
width: 100%;
height: auto;
padding: 0;
margin: 0px auto;
font-family: Calibri, Georgia, Ubuntu-C;
font-size: 16px;
margin-bottom: 20PX
}

#header{
width: 100%;
height: 139px;
background-image: url('images/Header_grey.gif');
}


#left_side {
width: 210px;
height: 700px;
background-image: url('images/Left_side.gif');
background-repeat:repeat-y;
overflow:hidden;
position:absolute;
font-size: 16px;
}

#content {
height: auto;
padding: 20px;
margin-left: 230px;
margin-right: 20px;
padding-bottom: 30px
}
<div id="header">
</div>

<div id="left_side">
</div>

<div id="content">
</div>

最佳答案

overflow: auto; 在需要时添加滚动条

#header{
width: 100%;
height: 139px;
background-image: url('images/Header_grey.gif');
overflow: hidden; /* code added to prevent scroll */
}


#left_side{
width: 210px;
height: 700px;
background-image: url('images/Left_side.gif');
background-repeat:repeat-y;
overflow:hidden; /* code added to prevent scroll */
position:absolute;
font-size: 16px;
}
#content{
height: auto;
padding: 20px;
margin-left: 230px;
margin-right: 20px;
padding-bottom: 30px;
overflow: auto; /* code added */
}

关于html - 只滚动内容div,其他的应该是固定的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17954181/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com