I want the text of the second and third divs to be on the right. I tried that by using margin-left: auto
and setting all divs to display: inline-block
. It didn't work with float: left
either. What have I done wrong?
It should look like this
.header > div {
display: inline-block;
}
.right-justified{
margin-left: auto;
width: auto;
}
<section class="header">
<div>
<div>Left</div>
<div>Left</div>
</div>
<div class="right-justified">
<div>Right</div>
<div>Right</div>
</div>
<div>
<div>Right</div>
</div>
</section>