Forum Moderators: not2easy

Message Too Old, No Replies

DIV problem

         

Sothpaw

4:57 pm on Jun 21, 2007 (gmt 0)

10+ Year Member



actually it may not even be a DIV problem at all.
imagine a picture floating left with some text bounding it.
now imagine several of these on top of each other.
well when i stretch the page to fit my screen suddenly where there is only a few lines of text, the next image below jumps up directly under the text and to the right of the image.

i was hoping a DIV would separate that but no function i've tried separates one div from another.

Fotiman

5:03 pm on Jun 21, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The only way to prevent that is to tell something to "clear" the floats. For example:

+- img --------+ Blah blah blah
¦ float: left; ¦ blah blah blah
+--------------+ blah blah blah
+- img --------+ Blah blah blah
¦ float: left; ¦
¦ clear: left; ¦
+--------------+

[edited by: Fotiman at 5:04 pm (utc) on June 21, 2007]

Sothpaw

5:43 pm on Jun 21, 2007 (gmt 0)

10+ Year Member



that helps thanks,
but...
the text from one group still slides up alongside the previous image.
it's like the DIV doesn't bound the group like a table would... but i don't want to use a table

Sothpaw

5:46 pm on Jun 21, 2007 (gmt 0)

10+ Year Member



here's my code.

<div>
<p>
<img style="FLOAT: left; clear: left" width="25%" hspace="5" src="pic.jpg">
text
</p>
</div>

<div>
<p>
<img style="FLOAT: left; clear: left" width="25%" hspace="5" src="pic2.jpg">
more text
</p>
</div>

DrDoc

5:48 pm on Jun 21, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Put each image/text group in its own div. Make the images float. Assign
clear: both;
to the divs.

Sothpaw

6:22 pm on Jun 21, 2007 (gmt 0)

10+ Year Member



thanks DrDoc, exactly what i needed. actually i was trying that out for myself as you sent that to me. but thanks a ton.