HTML & CSS · Middle · Question 56 of 75
How do you push the last item of a flex navbar to the far right?
.nav { display: flex; }
.nav .logout { margin-left: auto; }- ✓Correct answer: Give it
margin-left: auto- the auto margin absorbs the free space - 2Use
float: right - 3Use
justify-content: righton the item
Explanation
In flex layout auto margins take all remaining space in that direction. margin-inline-start: auto is the logical-property version that also works in RTL.