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?
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?
.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>
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