Re: [CSS2.1] Position of absolute position box in relative box with text-align center

Le 2014-09-15 19:45, Greg Whitworth a écrit :
> Hello all, I have the great pleasure of bringing another 2.1 interop
> issue to the list for discussion very close to the last one regarding
> placement of absolute positioned boxes [1]. This one is interesting as
> Chrome and FF place the box all the way to the left of the viewport
> while IE places it at the center. Based on the 2.1 spec [3], I believe
> that IE is doing the correct thing in this case. Here is a fiddle of
> the interop issue: http://jsfiddle.net/9wsegz9s/ and here is the
> markup with style inline for discussion:
> 
> <body style="text-align: center;">
>  <div style="display: inline; position: relative;">
>       <div id="parent" style="display: block; position: static;">
>            <div id="child" style=" display: block; padding: 5em;
> background-color: green; position: absolute; ></div>
>      </div>
>         </div>
> </body>
> 
> Since the wrapper box should be positioned at the center of the
> viewport due to text-align[2] the next inline box should be starting
> its positioning there as well. Thoughts?
> 
> Thanks!
> 
> Greg
> 
> [1] http://lists.w3.org/Archives/Public/www-style/2014Jul/0218.html
> [2] http://www.w3.org/TR/CSS2/text.html#propdef-text-align
> [3] http://dev.w3.org/csswg/css2/visuren.html

Greg,

Just a quick response.

http://www.gtalbot.org/BrowserBugsSection/css21testsuite/abs-pos-in-rel-pos-with-text-align-center.html

The vertical position where the black square is in IE11 is different 
from Chrome 37.0.2062.120 and Firefox 32. I think the black square's top 
edge should be at 52px (margin-top of p ==16px plus line box == 20px 
plus margin-bottom of p == 16px) from top of document box... but it 
seems definitely more than 52px in IE11. (I have no time right now to 
investigate this. I have not examined your test )

I do not have IE11. I just used IE NetRenderer:
http://netrenderer.com/

This should be my last message in this mailing list for the next 20 days 
or so. I have urgent tasks awaiting me for the next 20 days or so.

Gérard

Received on Tuesday, 16 September 2014 01:40:54 UTC