Tried many variations like this, but could not get it to work. Here is the last attempt:
.parent {
display: flex;
//justify-content: center;
width: 600px;
background-color: yellow
}
.c {
//flex: 1 1 0;
//text-align: end;
margin-left: auto;
margin-right: auto;
background-color: cyan;
}
.e {
//flex: 1 1 0;
// text-align: end;
background-color: grey;
}
.bs {
background-color: green;
color: white;
width: 70px;
}
with html:
<div class="parent">
<div class="c">
<button class="bs">OK</button>
<button class="bs">Cancel</button>
</div>
<div class="e">
<button class="bs">Help</button>
</div>
</div>
I know how to solve this by placing a 'visibility: hidden' button on the left-hand side and use justify-content with space-between, but I want to learn/know how to do it using CSS only.
Would be grateful for advice.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…