# 【代码】实现像本站这样兼容IE6,Firefox的悬浮代码 > 搞悬浮真的搞了不是一个月了,一直都在搞一直都搞的很恶心,有时候IE6能用firefox就不能用了,有时候firefox可以用IE6又不能用了,花了点时间总算筛选出来一套好用的悬浮代码,见下文 css部分 /\\/ /\ xuanfu Styles \/ /\\/ \ { padding: 0; ma 搞悬浮真的搞了不是一个月了,一直都在搞一直都搞的很恶心,有时候IE6能用firefox就不能用了,有时候firefox可以用IE6又不能用了,花了点时间总算筛选出来一套好用的悬浮代码,见下文 css部分 /\*------------------------------------------------------\*/ /\* xuanfu Styles \*/ /\*------------------------------------------------------\*/ \* { padding: 0; margin:0; } \* html #dock { position: absolute; top: expression((460 + (ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop)) + 'px'); } #dock\_wrap > #dock { position: fixed; top:76%; left:0px; margin-left:0px; } #dock\_wrap { position: relative; z-index: 20;} \* html #ceding { position: absolute; top: expression((460 + (ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop)) + 'px'); } #ceding\_wrap { position: relative; z-index: 20;} #ceding { position:fixed; top:50%; left:50%; margin-left:492px; } #dock { width:80px; overflow:hidden} #ceding a:hover, #dock a:hover { border-bottom:none; } #ceding img,#dock img { margin:0!important;padding:0!important;} html部分 [![联系站长!](http://wangbixi.com/wp-content/themes/mistylook/img/jiaotan.gif)](http://wpa.qq.com/msgrd?v=1&uin=55378929&site=qq&menu=yes) [![傻子-跸西blog](http://wangbixi.com/wp-content/themes/mistylook/img/index.gif)](http://wangbixi.com) [![傻子-跸西微blog](http://wangbixi.com/wp-content/themes/mistylook/img/weibo.gif)](http://t.qq.com/wiwjxx) 几点要注意的 1、css文件要加载css文件较靠上位置 2、html文件随便+哪里都可以. 3、img src="xxxx"其中xxx内容你自己弄图片OK结束了 兼容IE6 和火狐 --- **分类**:建站 **标签**:悬浮 · 代码 · ie6 · 兼容 · 火狐 **作者**:子龙 **链接**:https://octohz.com/p/2570