<分区>
如何在彼此之上创建两个 div
元素?
我想创建一个只有一页的网站,其中有两个 div
元素在彼此之上:
1- the one on top --> fixed
2- the one on bottom --> scrollable
谢谢,非常感谢您的帮助。
标签 javascript jquery html css
<分区>
如何在彼此之上创建两个 div
元素?
我想创建一个只有一页的网站,其中有两个 div
元素在彼此之上:
1- the one on top --> fixed
2- the one on bottom --> scrollable
谢谢,非常感谢您的帮助。
最佳答案
非常简单!!
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: 50px;
background: skyblue;
position: fixed;
}
#content {
height: 750px;
overflow: auto;
padding: 20px;
padding-bottom: 30px;
background: ORANGE;
}
<div id="header">
</div>
<div id="content">
</div>
关于javascript - 固定顶部 div 和底部可滚动 div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33707683/
相关文章:
javascript - Asp.net 使用 JavaScript 调用隐藏代码
javascript - 带有滑动页面和滑动图像的 Jquery
javascript - D3.js 水平折线图无法正确显示工具提示
javascript - 当您调用clear()然后在同一函数中设置一些本地存储值时不清除本地存储
javascript - 我如何修改这个 JavaScript 正则表达式来检查字符串是否是必须有最多 2 位小数的数字?
javascript - jQuery UI 可排序 : Scroll entire page as well as container
javascript - 为什么简单的 html 和 css 在 Angular 2 元素中的工作方式与 vanilla html 网站不同