-1

I need your help guys,

I tried float I tried display:inline-block and nothing work.
They keep moving like they want not as I want if u know what I mean.

So how should I solve this problem?

enter image description here

codelife
  • 51
  • 1
  • 8

2 Answers2

0

.block {
  width: 200px;
  height: 200px;
  border: 1px solid black;
}
.block2{
  position: absolute;
  right: 0;
  top:0;
}
.block3 {
  height: 400px;
  float:right;
}
    <div class="block1 block"></div>
    <div class="block2 block"></div>
    <div class="block3 block"></div>
MrFeeder
  • 9
  • 2
  • [How to Answer](https://stackoverflow.com/help/how-to-answer) strongly recommends only answering well-asked questions. Please also see: [Should one advise on off-topic questions?](https://meta.stackoverflow.com/questions/276572/should-one-advise-on-off-topic-questions) – Andreas Mar 18 '20 at 07:51
-1

You can use display: flex; property. This can give your expected result. At first wrap all your div elements with a single div. Then set that parent div's display to flex. No need to use absolute position.

<div class="block">
    <div class="child-left">Left side contents</div>
    <div class="child-right">Right side contents</div>
</div>

.block {
     display: flex;
     justify-content: space-between;
}

To know more about flex, check this link

  • [How to Answer](https://stackoverflow.com/help/how-to-answer) strongly recommends only answering well-asked questions. Please also see: [Should one advise on off-topic questions?](https://meta.stackoverflow.com/questions/276572/should-one-advise-on-off-topic-questions) – Andreas Mar 18 '20 at 07:51