I’m trying to create the following layout using CSS:

- Gray Rectangle = Container
- Blue Rectangle = Image
- White Rectangle = Content
Unfortunately the best I’ve been able to manage is this:

I have two problems with the content div:
- How to make the content div sit to the right of the image without hard coding the width.
- How to make the content div expand vertically to fill the container.
Apologies if a similar question has already been asked. I’ve read similar questions here but they all seem to relate to other layout concerns.
HTML:
<html>
<head>
<title>Test</title>
<link href="test.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div class="solid">
<img id="snapshot" src="page.jpg">
<div class="content" style="margin-left: 165px;">
Test
</div>
<br style="clear:both"/>
</div>
</body>
</html>
CSS:
#snapshot {
float: left;
}
div.solid {
padding: 5px;
border: 1px solid black;
background-color: #E8E8FF;
}
div.content {
border: 1px solid black;
background-color: #FFFFFF;
}
If you know the width of the image, you can do something like this: http://jsfiddle.net/EeLjd/
Use
position: absoluteon the content, and set theleftto the width of the image, plus the padding. Usefloat: lefton the image.