Reputation: 1144
Simple repro:
<div style="display: inline-block; position: relative; border: 1px solid black;">
short
<div style="display: flex; position: absolute; border: 1px solid black; top: 100%; left: 0;;">longerbox</div>
</div>
The flexbox element (longerbox) does not take up the width of its content like it does on Chrome. Is there a fix for this?
Upvotes: 1
Views: 2521
Reputation: 1144
Ok figured it out. Need an extra container for the flexbox just for positioning. i.e. don't have position: absolute and flexbox on the same element.
<div style="display: inline-block; position: relative; border: 1px solid black">
short
<div style="position: absolute; border: 1px solid black; top: 100%; left: 0">
<div style="display: flex">longerbox</div>
</div>
</div>
Upvotes: 3