Issue metadata
Sign in to add a comment
|
Absolutely positioned elements inside flex seems to not resolving their position properly
Reported by
i...@stfoo.ru,
Aug 10 2016
|
||||||||||||||||||||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36 Example URL: http://codepen.io/stfoo/pen/kXzPJJ Steps to reproduce the problem: 1. Create element and set display to flex and flex-direction to column. 2. Fill this element with two other elements. Set their height to non-zero. 3. Put new element in between theese two and set it position to absolute. What is the expected behavior? Absolutely positioned element should be positioned on top of the next one. What went wrong? It either on top or bottom of parent element (depends on justify-content) Does it occur on multiple sites: N/A Is it a problem with a plugin? N/A Did this work before? Yes Chrome 51 Does this work in other browsers? Yes Chrome version: 52.0.2743.116 Channel: stable OS Version: OS X 10.11.6 Flash Version: Shockwave Flash 22.0 r0 Code listing: http://codepen.io/stfoo/pen/kXzPJJ html: <div class="box"> <div class="foo"></div> <div class="absolute">Text</div> <div class="bar"></div> </div> css: .box { display: flex; flex-direction: column; } .foo, .bar { height: 100px; } .foo { background: #ccc; margin-bottom: 10px; } .bar { background: #acc; } .absolute { position: absolute; } In addition I checked that in Chrome 51, Safari 9.1.2 and Firefox 48.0. Everywhere except Chrome 52 it works as I expect it to.
,
Aug 10 2016
This is due to a spec change, see https://drafts.csswg.org/css-flexbox/#abspos-items See some discussion in bug 633011 . This is not a Chrome bug. Hopefully, other browsers will update to this new behavior soon. Note that Edge has the same behavior as Chrome. |
|||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||
Comment 1 by rsesek@chromium.org
, Aug 10 2016