Forum Moderators: not2easy

Message Too Old, No Replies

bizarre image float position

FF floats image at bottom of div

         

alexcallard

12:58 am on May 12, 2007 (gmt 0)

10+ Year Member



hello - have a very simple image floated to the left of an h1 and three ps, at the top of a left floated div in a two column layout.

ie floats it in place as you would expect, but ff drops it below all the text to the bottom of the div. I have tried setting the last paragraph to clear:left - no change.

the img style has auto height and width as it is dynamic.

I also tried setting position to relative - based on some similar ish problems i found - no change.
xhtml validates.
tearing out my hair now! never seen this before

Xapti

8:31 am on May 12, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Whats your Doctype and HTML/CSS code?

As far as I can tell, it seems you just put the image which needs to be floated physically after all the Ps and Header. This makes it float after the last P.

When an object is set to float, it floats AFTER the last block element it encountered.

That's why in some cases (depending how you floated and styled your colums), doing a three column layout like this
<leftdiv/><centerdiv/><rightdiv/> doesn't work, assuming center div is not floated. (there's all sorts of other ways to do a 3-column layout, work-aroundtoo, and what-not)

[edited by: Xapti at 8:33 am (utc) on May 12, 2007]