纯CSS定位的固定浮动层代码 不闪 兼容IE6 8 火狐 谷歌等
-
- .fixed-bottom
- {
- position: fixed; bottom: 0px; width: 1100px; left: 50%; margin-left: -550px;
- }
-
-
- * html,* html body
- {
- background-image:url(about:blank);
- background-attachment:fixed;
- }
- * html .fixed-top
- {
- position:absolute;bottom:auto;top:expression(eval(document.documentElement.scrollTop));
- }
- * html .fixed-right
- {
- position:absolute;right:auto;left:expression(eval(document.documentElement.scrollLeft+document.documentElement.clientWidth-this.offsetWidth)-(parseInt(this.currentStyle.marginLeft,10)||0)-(parseInt(this.currentStyle.marginRight,10)||0));
- }
- * html .fixed-bottom
- {
- position:absolute;bottom:auto;top:expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight-this.offsetHeight-(parseInt(this.currentStyle.marginTop,10)||0)-(parseInt(this.currentStyle.marginBottom,10)||0)));
- }
- * html .fixed-left
- {
- position:absolute;right:auto;left:expression(eval(document.documentElement.scrollLeft));
- }
-
- .fixed-middle {
- position: fixed; left:50%; top: 50%; margin-top: -80px;margin-left:-155px;
- }
-
-
- * html,* html body
- {
- background-image:url(about:blank);
- background-attachment:fixed;
- }
- * html .fixed-middle
- {
- position:absolute;
- bottom:auto;top:expression(eval(document.documentElement.scrollTop) + document.documentElement.clientHeight/2 - this.offsetHeight/2);
- margin-top:0px;
- }