Css 如何让推脚技巧在IE 8中发挥作用?
我用这个:Css 如何让推脚技巧在IE 8中发挥作用?,css,html,sticky-footer,Css,Html,Sticky Footer,我用这个: 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 a
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和IE6和IE7中运行得很好,但在8中却不行。有什么遗漏或错误?您的代码有一些大漏洞,所以我不得不做一些猜测。你可以测试这个,它在ff3、ie7和ie8上的工作原理与我测试的相同 我不确定这是否是你想要的,但你真的应该为你的问题提供一个更好的例子
<!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>
测试
html{
身高:100%;
保证金:0;
填充:0;
}
身体{
字体大小:12px;字体系列:“投石机MS”,verdana,arial,无衬线;
背景:#中交;;
单词包装:打断单词;
身高:100%;
保证金:0;
填充:0;
}
#包装纸{
文本对齐:左对齐;
高度:自动;
身高:100%;
边距:0自动-200px;/*底部边距是页脚高度的负值*/
填充:0px;
边界:0;
宽度:1000px;
背景:#FFFFFF;
}
.页脚,
.推{
高度:200px;/*.push的高度必须与.footer的高度相同*/
位置:绝对位置;
底部:0;
背景:红色;
}
洛勒姆
页脚jabba jibba jubba hubba bubba dubba dibba dei
我希望这会有所帮助。您能提供HTML以便人们可以测试它吗?