开发者

IE7 position fixed issue which Doctype doesn't fix

开发者 https://www.devze.com 2023-03-22 04:40 出处:网络
Just finishing up a site and having an issue with position: fixed on IE7. I\'ve Googled it and tried different Doctypes but the fi开发者_开发问答xed area is still moving out of position on IE7.

Just finishing up a site and having an issue with position: fixed on IE7. I've Googled it and tried different Doctypes but the fi开发者_开发问答xed area is still moving out of position on IE7.

I've not got IE7 but a client staffer has it and I can see the issue using an online IE renderer/tester.

I've removed the .htaccess from the test site so you can see the site/code.

http://drinkzing.com/test

Any advise or help would be appreciated.


There is a <div> and an <ul> element which both have id="logo-nav". They've both set position:fixed and some other properties. I think this is the main problem. Remove the duplicate ID, set position:fixed only for the <div> element and then we can investigate the issue (or the problem should disappear at best).

If you have newer version of Internet Explorer, you may emulate IE7 by clicking the Compatibility View button or choosing IE7 document mode in Developer Tools.

edit: I noticed that you haven't set any left property for #logo-nav. I don't know why IE7 computes the default position other way than all other browsers, but simply adding #logo-nav { left: 225px } works for me.


Try this in your css:

* html idorclasshere {
position: absolute;
}

Note: replace "idorclasshere" with your, well, ID or Class of the non-responding div (don't worry, due to the asterisk, other browsers aside from IE won't see it, add it in conjunction to your "position:fixed" style).

0

精彩评论

暂无评论...
验证码 换一张
取 消