Shashank Tripathi wrote:
Hi,
I have a problem with a centered DIV that I want to position
absolutely, at the top of my page.

The code is here -- http://sniptools.com/test.htm -- and I have
prominently commented the problem DIV inside the code. This is the DIV
that shows up in stark red. IE shows it way off the page despite these
settings:

<div style="background: #f00; position: absolute; width: 808px;
margin: 0px auto; top: 24px; ">

It shows up fine in Opera and FF, but looks like IE has problems with
"auto" margins or absolute positionings? Appreciate any ideas or
pointers.


You have an absolutely positioned element with an explicitly stated vertical position (top:24px) but only an implicitly stated horizontal position. Since the element appears in the source after main-body which is flated left and is 570px wide .... and the misplaced element is 570px from the left edge (do you have a pixel ruler?), one can only surmise that IE is using that 570px as the relative left edge for the absolute position.

Try adding clear:both to the style. Better yet, move it above main-body in the source.

--
Bob Easton
Accessibility Matters: http://access-matters.com

______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to