|
I'm creating a uservoice-like widget where I want a clickable image to position at the bottom-right of the page. I got it working in Safari and Firefox but IE (at least the one I use IE7/XP) doesn't obey position: fixed. Here's a portion of the embedded widget affected by the position issue:
Here's the the css:
You can see the widget in action here http://propsify.ca/embed/healthp2p.html |
|
Tried your link in IE8 and the widget wasn't using position:fixed either, but then noticed that IE was rendering the page in quirks mode, which was similar to my problem here. Adding the below DOCTYPE got it fixed (in IE8 atleast):
Hmmm, given that you have no control of the target pages, the only option then is to emulate position:fixed. It's one fugly hack though:
It would be better though if you could wrap #props-action in another container so you wouldn't have to assume it being a direct child of body:
The problem is I don't have control of the target pages. The idea is the users will just paste the widget code into whatever page they want. Yes, I can ask them to set the DOCTYPE but that IMHO is asking too much. Also, I can only imagine how setting the DOCTYPE would have unexpected results in their current website. 2
You could use expressions then to "fix" the element's position in the document, and make another non-quirks CSS rule to override it. The behavior when using expressions is a bit jumpy though, similar to what you'd get if you do it via JS. Thanks Erol. The image though flickers when I scroll in IE. But that's OK :) Nifty trick! =) |
|
Here's a snippet containing the use of expressions in CSS that Erol mentioned: CSS Position Fixed for IE6. It even mentions a fix for the jitter issue. [
|
|
I also found a CSS/HTML solution described here: A Better Fixed Positioning for Internet Explorer 6 The author's demo is located here: Position Fixed
He also mentions this solution's drawback:
Here's this other article, though, that uses the same solution, but raises the idea of working around the aforementioned drawback by using conditional comments for IE. Read it here, and look for the link about conditional comments. |