Forum Moderators: not2easy

Message Too Old, No Replies

absolute positioning IE6 vs IE7 and FF

!important fix not working on IE7

         

tito

7:30 pm on Aug 26, 2007 (gmt 0)

10+ Year Member



Hello,

before IE7 came out I was using the '!important' declaration to display difference in absolute positioning looking the same in IE6 and FF:
#navigation {position: absolute; top: 24!important; top: 25px;}

now on IE7, with the above, the positioning declaration does not work. please how can I solve this?

Thanks!
tito

Xapti

8:39 pm on Aug 26, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I don't know much about IE7 rendering (and it's bugs), but are you using proper code?

As far as I know, using proper CSS code, you should have no problems using absolute positioning with all 3 of those browsers.

It's best to not use!important for anything, as that's generally reserved for the user to add themselves for accessibility.

I'm not sure exactly what your goal is... did you want firefox to display the object 25 pixels form the top, and the other two browsers to display 24 pixels from the top?
If so, then you should use conditional comments.

If you have some other problem, then perhaps your code is improper, make surey ou have a proper doctype at hte top of your page, and it's useful if both your CSS and HTML code is W3C validated.

tito

9:12 pm on Aug 26, 2007 (gmt 0)

10+ Year Member



Thanks Xapti, yes I have the right DOC TYPE and proper code hopefully, I have noticed that if placing the!important declaration before, eg:
#navigation {position: absolute; top: 24!important; top: 25px;}
IE6 and FF work fine the same, but IE7 displays the object 1px less from the top.
viceversa FF works fine and both IE6 and IE7 display the object 1px less from the top.

at the end I've had to set the tag:

I had to set the
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="iehacks.css" />
<![endif]-->

and solved the issue.

Thanks so much!
tito