【发布时间】:2015-03-02 12:29:29
【问题描述】:
在我的代码中,只要我在 Google Chrome 中指定页面的高度,我的页脚就会显示在页面底部,上下没有空间。我试过做 height: 100% 等等,但还是有问题。
与我的 IE 11 相比,具有指定高度的页脚下方有空间。我似乎无法让这两个浏览器都妥协,我尝试了各种选项来让它们都工作。
我当前会影响页脚的css代码如下所示:
html {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
min-width: 768px;
/*keeps footer at bottom of page for IE 11 */
display: flex;
}
/* Formating for body of Web Site */
* {margin: 0; padding: 0;}
body {
font-family: times new roman;
background-color: #ebebeb;
zoom: 75%;
/*keeps footer at bottom of page for IE 11 */
width: 100%;
background-postion: 50% 80%;
}
#screen {
/* This locks everything in place*/
top:0px;
margin: 0 auto;
width:1500px;
height: 1500px;
padding-top:0;
padding-bottom: 30px;
postion: absolute;
margin-left: 70px;
margin-bottom: 0;
}
/* footer formating */
#footer {
background-color: black;
height: 40px;
width: 1500px;
color: white;
padding-top: 10px;
position: relative center;
bottom: 0;
text-align: center;
margin-left:70px;
}
我的html:
<html>
<div id = "screen">
<body>
............................................. other code
<div id = "footer">
Copyright Notice - Site Maintanence by **********
<br>
Author of Published Text Content: ************<br>
<a href = "#">Pagetop</a>
</div> <!-- end footer -->
</div> <!-- end screen format -->
</body>
</html>
IE 的样子:
【问题讨论】: