gpt4 book ai didi

html - 固定位置和滚动

转载 作者:太空宇宙 更新时间:2023-11-04 02:04:34 26 4
gpt4 key购买 nike

我正在使用以下代码来滚动中间部分并保持上半部分仍然可见:

<body style="overflow:auto">
<div class="table-layout" style="position:fixed;z-index:10000">
<div class="table-cell fixed-width-200" main-screen-title>
</div>
<div class="table-cell fixed-width-200">
</div>
<div style="height:50px;border-bottom:solid;border-width:1px;width:90%;">
</div>
</div>
<div ui-view style="margin-top:50px;width:99%;height:94%;top:50px;z-index:-1"></div>
</body>

CSS

<style>
.table-layout {
display: table;
width: 100%;
}

.table-layout .table-cell {
display: table-cell;
vertical-align:middle;
}

.fixed-width-200 {
width: 200px;
}

当我将内容加载到 ui-view 时,一切看起来都是正确的。调整浏览器大小并向下滚动后,内容将覆盖其上方的区域,而我希望它处于下方。知道我的代码有什么问题吗?

谢谢

最佳答案

最顶层的 div 是透明的。通过添加给它颜色

background-color: #fff;

到 .table-layout 类滚动部分将出现在其下方。

关于html - 固定位置和滚动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41050946/

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