How can i center a item in a flex row div, when has 2 childs?
I have 2 itens in the header, i tried
margin: auto
for the element, but he has a margin since the end of the first element. By this way, the middle of my second element isn't on the middle of the screen:
i want the middle of the section of buttons, in the middle of the screen4 Replies
consider the code:
You have flex on the section with buttons, justify content center
? yes, i have, with margin auto on the section that i want in the center
You have flex on the containing block which is putting the two sections next to each other. They are taking up all the space they can, 50% for each side.
You have to also center the content within those sections if you want it centered, it doesn’t inherit
If you want the middle of the section with the buttons to be in the middle of the screen it would need to be full width.
You don’t need two sections.But I don’t wanna confuse you. You need to decrease the width of the section with the image, or there’s no room for the buttons to move over