Here's a layout I've created, you can view it on CodePen.
.parent {
display: flex;
justify-content: space-between;
}
.left {
flex-grow: 1;
flex-basis: 0;
background-color: blue;
}
.right {
background-color: red;
flex-grow: 1;
flex-basis: 0;
}
.center {
background-color: green;
}
.parent-2 {
margin-top: 20px;
margin-left: 30px;
}
.parent-3 {
margin-top: 20px;
margin-left: 60px;
}
https://i.stack.imgur.com/6Z5FZ.png The margin from the left of the last two items is causing their contents to be misaligned vertically. I want to align the red and green parts with each other while keeping the blue part misaligned. Is there a way to achieve this alignment?
Edit: I also need this alignment to work automatically for any number of nested items.