I have a parent div that must stay at 100% with 3 child divs inside. I need to center the 3 child divs, but don\'t know how.
Flex solution: set justify-content: center; to the parent element:
.parent { display: flex; justify-content: center; /* align-items: center; /* To align vertically, if needed */ } .parent, .child { border: 1px solid #000; }
child1 child2 - center us child divs! :) child3