Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Absolutely positioned flexbox doesn't expand to fit contents Reply To: Absolutely positioned flexbox doesn't expand to fit contents

#248982
madhurgarg
Participant

If you want to give display:flex to absolutely positioned element, then you have to set left:0, right:0 like this:

.parent {
   position: absolute;
   left: 0;
   right: 0;
   display: flex;
}

This worked for me !