I've created this code below to simulate the same problem on a website I'm developing to practice my html and css. I have two elements that float to the left and one to the right but when I clean the float of the second element the third element (right) is pushed down. How do I solve this? html:
<div class="primeiro"></div>
<div class="segundo"></div>
<div class="terceiro"></div>
**css:**
div{
width: 20px;
height: 20px;
background: pink;
border: 2px solid black;
}
.primeiro{
float: left;
}
.segundo{
float: left;
clear: left;
}
.terceiro{
float: right;
}