Computer >> Computer tutorials >  >> Programming >> Javascript

Does 'position: absolute' conflict with flexbox?


Absolutely positioning will not conflict with flex containers. You need to set the parent width and values as well:

.parent {
   display: flex;
   justify-content: center;
   position: absolute;
   width:100%
}

The following is the HTML:

<div class = "parent">
   <div class = "child">text</div>
</div>