首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在IE 8中使用推送页脚技巧?

如何在IE 8中使用推送页脚技巧?
EN

Stack Overflow用户
提问于 2009-03-23 19:37:18
回答 1查看 3.1K关注 0票数 1

我使用的是:

代码语言:javascript
复制
body {font-size:12px; font-family:"trebuchet MS", verdana, arial, sans-serif; background: #CCCCCC; word-wrap:break-word; height: 100%; margin: 0; padding: 0;
}

#wrapper {
    text-align: left;
    height:auto;
    height: 100%;
    margin: 0 auto -200px; /* the bottom margin is the negative value of the footer's height */
    padding: 0px;
    border:0;
    width: 1000px;
    background: #FFFFFF;


.footer, .push {
    height: 200px; /* .push must be the same height as .footer */
    position:absolute;
}

它看起来似乎在Firefox/Safari/Opera和IE 6和7中运行良好,但在8中却不能正常工作。

EN

回答 1

Stack Overflow用户

发布于 2009-03-24 12:16:55

你的代码中有一些很大的漏洞,所以我不得不做一些猜测。你可以测试这个,它在我测试的ff3,ie7和ie8上似乎是一样的。

我不确定这是否是你想要的,但你真的应该为你的问题提供一个更好的例子。

代码语言:javascript
复制
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>test</title>
    <style type="text/css">
html{
    height:100%;
    margin: 0; 
    padding: 0;
}
body {
    font-size:12px; font-family:"trebuchet MS", verdana, arial, sans-serif; 
    background: #CCCCCC; 
    word-wrap:break-word; 
    height: 100%; 
    margin: 0; 
    padding: 0;
}

#wrapper {
    text-align: left;
    height:auto;
    height: 100%;
    margin: 0 auto -200px; /* the bottom margin is the negative value of the footer's height */
    padding: 0px;
    border:0;
    width: 1000px;
    background: #FFFFFF;
}

.footer, 
.push {
    height: 200px; /* .push must be the same height as .footer */
    position:absolute;
    bottom:0;
    background:red;
}

    </style>
</head>
<body>
    <div id="wrapper">Lorem</div>
    <div class="footer">Footer jabba jibba jubba hubba bubba dubba dibba dei</div>
</body>
</html>

我希望这能有所帮助。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/674921

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档