Reputation: 7628
How can I extend div that has position:relative
automatically? Should I use jQuery? It is okay, Please Help me!
I made a fiddle. If you see that, you can understand easily what I intend to.
https://jsfiddle.net/bexoss/roacL7o1/
Upvotes: 0
Views: 1451
Reputation: 1091
Here is a correction:
.div1 {
position:relative;
min-height:100px;
background-color:#ddd;
}
.div2 {
position:relative;
left:0; background-color:red;
width:200px;
display:inline-block
}
.div3 {
position:relative;
left:250px;
background-color:yellow;
width:200px;
display:inline-block;
vertical-align:top;
}
The main issue was that when elements are positioned with absolute
, they are not part of the normal document flow.
Upvotes: 1