问题
I want the second div to align at the right to place it in where it should be but is it possible if they're displayed in flex? Help me guys this one gives me headache.
login.html
<div style="display: flex;">
<div (click)="openPasswordRecovery()" style="color:gray">
Remember Me
</div>
<div style="text-align: right; color:gray">
Forgot Password?
</div>
</div>
回答1:
Use space-between
, the last item always goes to the end:
<div style="display: flex; justify-content: 'space-between'">
Learn more about justify-content here
来源:https://stackoverflow.com/questions/58461318/how-to-align-the-second-div-to-right-when-the-two-divs-are-displayed-in-flex