I have two elements in my web page, let's say:
.host {
display: flex;
justify-content: spece-between;
}
.left {
width: 300px;
margin-bottom: 20px;
}
.right {
width: 300px;
}
<div class='host'>
<div class='left'></div>
<div class='right'></div>
</div>
This puts the left and right div on the same row when the host div is wide enough. And wrap the row if the width of the host div is less than 600px.
The thing is that I want to add a margin between the left and right div, otherwise when the width of the host is exact 600px, there is not space between the two.
I can't simply add a margin-right
to left div because that will make the two element have different width when the row is wrapped.
Is there some elegant solution to achieve that?
Thanks!