position back and above

1

I want to create the following figure:

       h
       h
hhhhhhhh

but I can not, this is my code:

.car{
width:100px;}

.Loader {
  width: 100px;
  height: 10px;
  background-color: red;
}

.Back {
  width: 10px;
  height: 50px;
  background-color: red;
  float:right;
}
<div class="car">
<div class="Back">
</div>
<div class="pala">
</div>
<div class="Loader">
</div>
</div>
    
asked by hubman 05.12.2017 в 23:17
source

1 answer

1

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.

    
answered by 05.12.2017 / 23:27
source