gpt4 book ai didi

html - 两个带有固定页眉和页脚的可滚动内容栏

转载 作者:太空宇宙 更新时间:2023-11-04 00:41:38 24 4
gpt4 key购买 nike

我有这段代码,要求将另一个侧边菜单添加到我现有的页面

https://jsfiddle.net/84j7wcqa/

<div class="wrapper">
<div class="header">
<div class="inner">header</div>
</div>
<div class="top">
<div class="inner">top</div>
</div>
<div class="content">
<div class="inner">
<div class="right">
<div style="height:1000px;">right</div>
</div>
</div>
</div>
<div class="footer">
<div class="inner">footer</div>
</div>

html, body {
height: 100%;
margin: 0;
}

.wrapper {
height: 100%;
width: 100%;
display: table;
}

.header, .content, .footer, .top {
display: table-row;
}

.header, .footer {
background: silver;
}

.inner {
display: table-cell;
}

.content .inner {
height: 100%;
position: relative;
background: pink;
}

.right {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
overflow: auto;
}

.top {
background-color: gold;
}

看起来是这样的:

enter image description here

但我想要一个可滚动的附加内容,看起来像这样

enter image description here

问题:这可以用 table/table-row/table-cell 方法解决吗?

最佳答案

在此链接中查看我的回答。希望这可以帮助。 https://jsfiddle.net/m2vpcs1u/3/

HTML:

    <div class="wrapper">
<div class="header">
<div class="inner">header</div>
</div>
<div class="top">
<div class="inner">top</div>
</div>
<div class="content">
<div class="inner">
<div class="right">
<div style="height:1000px;">right</div>
</div>
<div class="left">
<div style="height:1000px;">left</div>
</div>
</div>
</div>
<div class="footer">
<div class="inner">footer</div>
</div>
</div>

CSS:

html, body {
height: 100%;
margin: 0;
}

.wrapper {
height: 100%;
width: 100%;
display: table;
}

.header, .content, .footer, .top {
display: table-row;
}

.header, .footer {
background: silver;
}

.inner {
display: table-cell;
}

.content .inner {
height: 100%;
position: relative;
background: pink;
}

.right {
position: absolute;
left: 50%;
right: 0;
top: 0;
bottom: 0;
overflow: auto;
width:50%;
}
.left {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
overflow: auto;
width:50%;
}


.top {
background-color: gold;
}

关于html - 两个带有固定页眉和页脚的可滚动内容栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58196363/

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