How can I make a flexbox parent the width of my children?
I have a parent element with two elements inside:
<div class="parent"> <div class="child"> one </div> <div class="child"> two </div> </div> Currently .parent is 100%. I would like it to be only the width of two children.
.parent { display: flex; background-color: aliceblue; } How to make a parent be the width of its contents and not wider?
+6
1 answer