Forum Moderators: not2easy

Message Too Old, No Replies

floating a div within another div

independently of position in code

         

ppg

9:10 am on Aug 26, 2004 (gmt 0)

10+ Year Member



I have a div within another div which I'm floating right so that the text in the containing div wraps round it. It works fine, but I want the code for the internal div to be below the text in the containing div within the code. If I do this, the internal div displays at the bottom of the containing div.

Is there a way I can push it back to the top, still have it at the bottom of the code for the containing div and have the text still wrap?

thanks

Span

10:01 am on Aug 26, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



No, that's not possible without some kind of trick.

You could put the code for that div at the bottom of the container div but then you have to position it absolute instead of floating it. When you do that your paragraphs of text need a right margin to make room for the positioned div - but then your text won't wrap anymore.

Or you could use a dummy float. An empty div with the right size to make the space in your text and then put the code for your absolute positioned div at the bottom of the container div.

ppg

11:47 am on Aug 26, 2004 (gmt 0)

10+ Year Member



> An empty div with the right size to make the space in your text and then put the code for your absolute positioned div at the bottom of the container div.

Very nice idea Span, thanks.

Works like a charm in this case since the internal div is always the same size.