0
I have a list of 3 items, all items are behaving like inline-block, however I gave the first and last item float: right
and float: left
, respectively.
The question is, why the middle item (box-2
) was not over put by the item on the left since it is in a new context?
How it continues to be rendered with background and box size?
It wasn’t meant to be blown by box-1
?
.caixa{
width: 25%;
height: 150px;
display: inline-block;
}
.box-1{
background: #F54958;
float: right;
}
.box-2{
background:#ED49F5;
float: left;
}
.box-3{
background: #EB5A46;
}
<ul class="lista">
<li class="caixa box-1">Primeiro</li>
<li class="caixa box-2">Segundo</li>
<li class="caixa box-3">Terceiro</li>
</ul>