I'm trying to get two separate elements side by side inside one div but second one should be right side of div
<div className={classes.container}>
<div className={classes.first}>
First
</div>
<div className={classes.second}>
Second
</div>
<div>
I tried to give both display: "inline-flex"
which sets them side by side. Then I tried to move second div to right side of container div with flex: 1
, but second div didn't move anywhere. Then tried also give container div justifyContent: "space-between"
and that didn't do anything either. So problem is how to set second div to right side of container div.
container: {
justifyContent: "space-between"
},
first: {
display: "inline-flex",
flex: 1,
},
second: {
display: "inline-flex"
},
Any ideas how to move second div to right side of container div?
question from:
https://stackoverflow.com/questions/65860447/positioning-inline-flex-elements-inside-div 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…