To achieve what you want you must play with position: relative
and position: absolute
, and with the coordinates top
, left
, right
and bottom
in the elements, in the following way:
I hope to have been clear with the explanation, if you have any questions, I will gladly resolve them.
.car{
width:100px;
position: relative;
height: 50px;
}
.Loader {
width: 100px;
height: 10px;
background-color: red;
position: absolute;
left: 0;
bottom: 0;
}
.Back {
width: 10px;
height: 50px;
background-color: red;
position: absolute;
top: 0;
right: 0;
}
<div class="car">
<div class="Back"></div>
<div class="pala"></div>
<div class="Loader"></div>
</div>
Note: It is important to emphasize that the parent of the elements must have position: relative
so that the child elements (that have position: absolute
) are co-ordinated based on the size of the elements. his father.