Css IE6固定定位

Css IE6固定定位,css,internet-explorer-6,Css,Internet Explorer 6,我需要在视口底部固定一个页脚。IE6就是问题所在——是的,它必须在IE6中工作。那么多,不是我的决定 使用此选项: div#footer { width:1020px; position: absolute; top: expression(0+((e=document.documentElement.scrollTop)?e:document.body.scrollTop)+'px'); left: expression(50%+((e=document.documentEleme

我需要在视口底部固定一个页脚。IE6就是问题所在——是的,它必须在IE6中工作。那么多,不是我的决定

使用此选项:

div#footer {
 width:1020px;
 position: absolute; 
 top: expression(0+((e=document.documentElement.scrollTop)?e:document.body.scrollTop)+'px'); 
 left: expression(50%+((e=document.documentElement.scrollLeft)?e:document.body.scrollLeft)+'px');} 
}
在我的IE6.css中,我可以将页脚固定在页面顶部。但如果我换成这个:

div#footer {
 width:1020px;
 position: absolute; 
 bottom: expression(0+((e=document.documentElement.scrollBottom)?e:document.body.scrollBottom)+'px'); 
 left: expression(50%+((e=document.documentElement.scrollLeft)?e:document.body.scrollLeft)+'px');} 
}
事情变得一团糟。将表达式函数固定到视口底部是否实现错误


谢谢

试着用这个代替表达式:

* {
    margin: 0;
}
html, body {
    height: 100%;
    overflow: auto;
}
.wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: auto;
}
.box {
    position: fixed;
    left: 50%;
    top: 180px;
    margin: 0 0 0 -370px;
}
* html .box { 
    position: absolute;
}

/*

Fixed Positioning in IE6 
http://ryanfait.com/

*/

请尝试使用以下表达式而不是表达式:

* {
    margin: 0;
}
html, body {
    height: 100%;
    overflow: auto;
}
.wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: auto;
}
.box {
    position: fixed;
    left: 50%;
    top: 180px;
    margin: 0 0 0 -370px;
}
* html .box { 
    position: absolute;
}

/*

Fixed Positioning in IE6 
http://ryanfait.com/

*/

不要使用
表达式
子句。根据我的经验,它可以使页面有点慢,并且表现得很奇怪。有些时候,它会起作用,而有些时候,它只会失败,而不是优雅地失败

我用这些方法取得了很好的成功


但是如果不查看整个页面,就很难看到我提供的任何链接是否会妨碍您当前的样式表。

不要使用
表达式
子句。根据我的经验,它可以使页面有点慢,并且表现得很奇怪。有些时候,它会起作用,而有些时候,它只会失败,而不是优雅地失败

我用这些方法取得了很好的成功


但是如果不查看整个页面,就很难看到我提供的任何链接是否会妨碍您当前的样式表。

作为ie6.css样式表?或者只是一般地?并不是说我不喜欢这种方法,而是我最感兴趣的是让expression标记的语法适用于位于底部的元素!此方法仅适用于IE6。我是通过谷歌搜索找到的。作为ie6.css样式表?或者只是一般地?并不是说我不喜欢这种方法,而是我最感兴趣的是让expression标记的语法适用于位于底部的元素!此方法仅适用于IE6。我是通过谷歌搜索找到的。