views:

43

answers:

2

I want to create the following situation:

+--------------------------------------+-----------------------+
|                                     1|                       |
|  IMAGE IMAGE IMAGE IMAGE IMAGE IMAGE |  TEXT TEXT TEXT       |
|2                                     |                       |
+--------------------------------------+-----------------------+

Everything is included in a div called "caption"
The text is in a div called "textarea"
The image is in a div called "imagearea"

The text area has a fixed width
the image size can change. It should be aligned to the top right (1) and should overflow from the bottom left (2)

How can I do this with CSS?

+1  A: 

float:right ?

Jeriko
+3  A: 

Float the text area to the right with a set width. This takes it out of the flow of the document.

Set the right margin of the image div to the width you want it away from the text. The div should automatically take up the rest of the area and the text div should cover the margin area. set the background image to 100% 100% for the image div.

Thorn007
If you need code let me know. You can also view my blog and view the CSS with firebug or something. it does the same thing for my nav. inteldesigner.com
Thorn007
Great! it works! but why?. If I drop the margin of the image to be less than the width of the text or if I drop the 100%, it seems to break..
shoosh
for info on the 100% thing check out this post i made http://inteldesigner.com/2010/code/background-image-positioning-explained.When you set the margin to the width of the div the margin keeps the text div from pushing it down. basically because the floated div is separated from the layout it has no effect on the image div unless the content areas touch.
Thorn007
Sound like a post for my blog :D now that I think of it
Thorn007
just realized you might want to make it 100% 0
Thorn007