I want to position a dynamic logo (width variable/unknown) next to some content, inside a container (see attached mockup - logo is on the right hand side in green, content is in blue). I specifically want the content div to stretch to the full remaining width of the page as shown in the mockup:
But when I try to float the content to the left and the logo to the right (jsfiddle), the logo gets positioned below the content unless I set the content width to less that 100% (and I can't know the content width because the logo width can vary).
HTML:
<div id="container">
<div id="content"></div>
<div id="logo"></div>
</div>
CSS:
#content {
border: 1px solid green;
height: 300px;
width: 100%;
float: left;
}
#logo {
border: 1px solid red;
width: 50px; /*unknown width*/
height: 50px;
float: right;
}
How do I stretch the content div to the full container width, minus the width of the logo?