As the title says, i wanted to place two divs horizontally in a single line. The left side div is of fixed width(which contains an image) while the right side div should occupy the rest of the space.
CSS:
.container{
width:100%;
background-color:#000000;
height:auto;
}
.inner_left{
width:150px;
float:left;
height:250px;
background-color:#FF0000;
}
.inner_right{
float:left;
height:250px;
width:78%;
}
HTML :
<div class="container">
<div class="inner_left">test</div>
<div class="inner_right">Nam a congue risus. Mauris mattis facilisis nisi, eget convallis enim lobortis a. Curabitur non neque nec augue commodo ullamcorper sit amet et lorem! Proin tristique vitae lacus ut consectetur. In at convallis dolor, in laoreet dolor. Etiam in molestie enim! Nunc tincidunt pharetra magna, et sollicitudin enim sodales sed. Morbi pretium sollicitudin lorem, bibendum molestie libero consectetur eu. Nunc aliquet eros purus, vel ultricies sem volutpat quis. Fusce nisi ligula; venenatis tristique turpis sit amet, semper adipiscing ante. Aliquam in justo fermentum, interdum nulla vestibulum, ornare augue.
</div>
</div>
What i have tried :
http://jsbin.com/arIPIHe/2/
http://jsbin.com/arIPIHe/3/
The second link works correctly as long as i don't alter the browser resolution. As soon as i reduce the browser width, the right side div goes to next line under the left div.
I have created the jsbin demo with the elements that i have in the work. I made the bin since the main one is quite large and contains lot of elements inside it.
Ive searched around in Google as well as stack and got the following links, but i tried the same and it doesn't help me as such.
How to place two divs side by side where LEFT one is sized to fit and other takes up remaining space?
Two divs, one fixed width, the other, the rest
How can i position the right side div so that it will always remain next to the left div and also occupy the width remaining. I cannot get my head around this.