位于页面底部的页脚有固定页眉
我想将页脚放在页面底部,它还有一个固定的标题...
不是position: fixed - 我不希望它留在屏幕上,它应该只是在页面的末尾,并在滚动时表现正常。
不在可见屏幕的底部 - 在页面的底部,即; 毕竟其他内容。
这是代码:
我准备了一个演示:JSFiddle
或者见下文
<div id="header">Header</div><div id="content"> <p>Some content...</p> </div><div id="footer">Footer</div>
body{
/* Just to enable scrolling in JSFiddle */
height: 1000px;}#header{
width: 100%;
height: 100px;
position: fixed;
top: 0px;
z-index: 1;}#content{
width: 100%;
position: absolute;
top: 100px; /*Height of header*/
z-index: 0;}#footer{
width: 100%;
height: 100px;
position: absolute;
bottom: 0px;}/*For demo only*/#header, #footer{
border: 3px dashed #333333;
background: #FFFFFF;}#content{
background: #CCCCCC;
height: 200px;}
饮歌长啸
拉风的咖菲猫
至尊宝的传说
随时随地看视频慕课网APP