I am trying to find a way where two divs can stand next to each other side by side and div one has a content some writing maybe. While div 2 also contains some text.
Div one should adjust the width automatically with respect to the width of div 2, so that the height increases instead of width when the content in div 1 increases and it should not push the div 2 out or it should not effect the div 2.
Please follow the link. Where red div should adjust its width with respect to the green div.
#box1 {
background: red;
height: 100px;
width: auto;
float: left
}
#box2 {
background: green;
height: 100px;
width: 400px;
float: right
}
<div id="wrapper">
<div id="box1">
<bold>BOX 1</bold><br>Is there any way, box2 can stand next to the box 1 without limiting the width of box1. (Repeat)Is there any way, box2 can stand next to the box 1 without limiting the width of box1</div>
<div id="box2">
<bold>BOX 2</bold><br>Is there any way, box2 can stand next to the red without limiting the width of box1</div>
</div>