css - 溢出:自动无法正常工作
问题描述
我希望这个页面有一个固定的顶部和一个底部来填充剩余的视口。底部将用于显示jpg。当 jpg 太大时,我希望滚动条只出现在底部。我已经尝试了我认为 3 个 div 的固定和绝对的所有组合,但没有一个组合能够提供我正在寻找的功能。下面的代码在需要时显示水平滚动条,而不是垂直滚动条。任何帮助都会很棒。这是我所拥有的:
<body>
<style>
body
{
margin: 0;
padding: 0;
border: 0;
}
#Top
{
position: fixed;
left: 0;
top: 0;
height: 200px;
width: 100px;
background: red;
}
#Bottom
{
position: fixed;
top: 200px;
width: 100%;
background: green;
overflow: auto;
}
#Content
{
width:100%;
height: 100%;
background: purple;
overflow: auto;
}
</style>
<body>
<div id="Top">
</div>
<div id="Bottom">
<div id="Content">
<!-- This is just a blue box that should cause scroll
bars to appear when the viewport is resized too small.-->
<img src="Blue500x1000.jpg">
</div>
</div>
</body>
解决方案
推荐阅读
- python - Pathlib 仅通过子目录循环
- c++ - 如何在 ARM ELF 文件中找到函数内存映射?
- python - 生成代码时的错误消息 - selenium 和 python 类型错误
- azure - Octopus Deploy:操作返回了无效的状态代码“冲突”
- firebase - docker stop 时优雅地停止 firebase 模拟器
- docker - 尝试将撰写文件转换为 kubernetes 清单时出错
- javascript - 如果数组的对象在 Javascript 中包含多个逗号分隔值,则复制整个数组
- terraform - Terraform - 源模块可以为每个实例操作系统使用不同的数据源吗?
- c# - C# Selenium Element 使用 xpath 查找问题
- css - 如何隐藏左边:-100%