在HTML / CSS中定位页脚时遇到问题

时间:2014-07-15 08:53:55

标签: html css

我有一个包含一些内容的页面和一个页脚的页脚。但页脚有问题。我的页脚粘在内容上,不要留在底部。当我对身体使用位置:相对位置时:绝对;底部:0; 页脚粘在底部但是当我缩放并向下滚动时它位于页面中间。我该如何解决这个问题?

这是我的身体代码:

width: 100%;
padding: 0;
margin: 0;
background: -webkit-linear-gradient(left,#000 0%,#222 100%);
background: -moz-linear-gradient(left,#000 0%,#222 100%);
background: -ms-linear-gradient(left,#000 0%,#222 100%);
background: -o-linear-gradient(left,#000 0%,#222 100%);
background: linear-gradient(left,#000 0%,#222 100%);
min-width: 970px;
position: relative;

这是我的页脚代码:

color: rgba(255,255,255,0.8);
text-align: center;
font-family: roya;
font-size: 0.9em;
letter-spacing: 0.07em;
line-height: 0.5em;
position: absolute;;
left: 0;
bottom: 0;
width: 100%;
min-width: 970px;
height: 65px;
clear: both;
background: #222;
border-top: 2px solid #666;
border-radius: 100px 100px 0 0;
margin: 0;

另一件事是:我的页面通常没有滚动一些小设备

1 个答案:

答案 0 :(得分:0)

您是否尝试将body设置为{height:100%;}?

相关问题