I am creating a flexbox layout. I want two flex containers to be displayed inline and have an equal amount of space between them and back sides of the screen (that is, equal margin-left of the first one and margin-right of the second one). Now all I know about CSS flexboxes is display: flex and display: inline-flex, so I would want to avoid solution paths that include advanced flexbox properties.
To do so, I set the document's margin and padding to 0, box-sizing to border-box to prevent the containers from changing their original width, set the display property to inline-flex, gave both containers equal measurements.
.item1 {
display: inline-flex;
margin-top: 5vh;
background-color: #ff8000;
border: 3px solid transparent;
height: 30vh;
width: 40vw;
/*margin-left: 9vw;*/
}
.item2 {
margin-top: 5vh;
display: inline-flex;
background-color: #ff8000;
border: 3px solid transparent;
height: 30vh;
width: 40vw;
/*margin-right: 9vw;*/
}
<div class="item1"></div>
<div class="item2"></div>
I also set margin-left of the first item equal to the margin-right of the second one, but they're blatantly different visually.