Forum Moderators: not2easy

Message Too Old, No Replies

position: absolute; right: 0px; IE Bug?

one pixel off

         

Aberdeen

3:12 am on May 19, 2004 (gmt 0)

10+ Year Member



when i use absolute positioning with right: 0px; IE indents it 1 px showing the background. It works correctly on all the other browsers, so I curious why this is happening. Is it a bug, I did not know about.

#rightcontent {
position: absolute;
top: 80px;
right: 0px;
width:151px;
background: url("normal-right-bg-short.jpg") top right repeat-y;
font-size: 11px;
text-align: center;
color: #999;
}

Any help?

Cheers

DrDoc

4:25 am on May 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, it's a bug. You need a 1px negative right margin for it to work properly in IE.

Aberdeen

4:44 am on May 19, 2004 (gmt 0)

10+ Year Member



Thankyou.

I hate doing these work arounds for IE bugs

Big_John

9:21 pm on May 22, 2004 (gmt 0)

10+ Year Member



This is not a bug, unless you want to define something that happens in all browsers as a bug. It's a rounding error, and I wrote a page explaining it here:

[positioniseverything.net...]

IE is mostly free of rounding errors, except with AP boxes on the right and bottom. Gecko is much worse, and Opera 7 is nearly free of this problem.

SuzyUK

1:31 pm on May 23, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Big John - Welcome to WebmasterWorld

and picking your brain already :)

This is not a bug, unless you want to define something that happens in all browsers as a bug.

the rounding error/no bug theory, I understand, but it does seem (in the few tests I did) that IE is the only one that's having problems with this particular combination.

Here's my thinking..
The Absolutely Positioned(AP) element (in the first post) has explicit widths so it shouldn't round therefore I'm presuming in this case that the AP element itself is positioned *inside* a relatively sized container. (presuming because that's the only way I can see the 1px gap described and yes it does move on scrolling..)

So even if it is a rounding "error" on the container element, that shouldn't affect the position of the element *inside* it should it, I mean 0px right should be 0px right no matter what pixel size the container decides to be?

Suzy

photon

3:47 pm on May 23, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Big_John, welcome to WebmasterWorld!

It's great to see you here. I'm looking forward to your posts.

Big_John

8:05 pm on May 23, 2004 (gmt 0)

10+ Year Member



Sorry about the link, I'm new here.

Yes, the container is the key to this variant of the rounding error. Messing with the AP element (width, or other values) has no effect. If the container gets an explicit pixel width, or height in the case of a "bottom" positioned AP box, then there is no error.

Mozilla can also show this error under certain conditions, but it can make the error go both inside AND outside, compounding the problem. This, and all rounding errors, have the characteristic of being dynamic when the window width is mouse-dragged wider and narrower. It flickers on and off.

Thanks to this issue, no "rounded corners" scheme uses AP corner images, which is arguably the most logical way to do it. To restate, any width (or non-width) on the container other than pixels is vulnerable.

Opera currently has the best error prevention performance, altho that demo page I mentioned can
still crack Opera like an egg. Normally errors are just "one-level" issues, and Opera does kill those easily.

Happily, floats don't suffer from the error. That would be a little too much to take, IMO.