【发布时间】:2017-07-28 00:41:47
【问题描述】:
我有一个带有滚动内容的部分透明的固定页脚和页眉:https://jsfiddle.net/ru8jgxg9/
当存在溢出内容时,需要对该 JSFiddle 进行哪些更改以将垂直滚动条保持在顶部(但也要使滚动条保持窗口的整个高度)?
我注意到 stackoverflow.com 似乎可以做到:
html {
height: 100%;
}
body {
height: 100%;
}
/* Fixed Header */
.dvTableTop {
display: table;
width: 100%;
border-style: solid;
border-width: 0px 0px 2px 0px;
border-color: #000000;
top: 0px;
height: 50px;
position: fixed;
left: 0;
right: 0;
opacity: 0.7;
background-color: Red;
z-index: 1030;
}
/* Scrollable Content */
.dvContentContainer1 {
position: fixed;
top: 0;
bottom: 0;
padding-top: 30px;
overflow: auto;
left: 0;
right: 0;
}
/* Fixed Footer */
.dvFooterContainer1 {
position: fixed;
height: 50px;
background-color: Yellow;
bottom: 0;
left: 0;
right: 0;
opacity: 0.7;
}
【问题讨论】:
标签: javascript jquery html css