2009/02/24

Fixed postion in IE6

To have something always shown on the same position on a page, we can use css position property and set it to "fixed", however it doesnot work in IE6. There might be some hack to make this happen in IE6, actually I searched along trying to find one, but have not find a good solution yet. Anyway I am not going to spend time on the IE hack, what I going to do is just hidded this funtion in IE6. Complaint? Who care! Why not just leave that old buggy stupid IE6, you have a lot of option, have not you?
So the html code is like this:
<div id="footerud">
<div id="up"></div>
<div id="down"></div>
</div>
The css is that:
#footerud{bottom:10px;display:block !important;position:fixed;left:15px;}
#up{
background:url(../images/arrowtop.png) no-repeat;
cursor:pointer;
height:14px;
margin-bottom:15px;
position:relative;
width:25px;
}
#down{
background:url(../images/arrowbottom.png) no-repeat;
cursor:pointer;
height:60px;
margin-top:15px;
position:relative;
width:25px;
}  
To hidded this on IE6, I added style into html code, like
<div id="footerud" style="display:none;">
 
Will that hidded it from Firefox or IE7? Don't worry, because we have this in the css file,
#footerud{bottom:10px;display:block !important;position:fixed;left:15px;}
The !important generally means the attribute cannot be overwrote, fortunately, IE6 does not recognized it, so it will be hid.
 

No comments:

Post a Comment