By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,648 Members | 1,198 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,648 IT Pros & Developers. It's quick & easy.

Text wrap around positioned float

P: n/a
I'm using relative positioning to move a right-floated image 10px upwards..
Text wrapping around the image should go underneath it once it reaches the
bottom of the image, yet it acts as if the image is still in it's original
position and doesn't start wrapping until it's 10px below the bottom of the
image. How can I work around this?

TIA,
Aaron
Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"Aaron" <ag********@comcast.net> wrote in
news:AL********************@comcast.com:
I'm using relative positioning to move a right-floated image 10px
upwards.. Text wrapping around the image should go underneath it once
it reaches the bottom of the image, yet it acts as if the image is
still in it's original position and doesn't start wrapping until it's
10px below the bottom of the image. How can I work around this?


Use a negative margin (margin-top: -10px) rather than relative positioning.
With relative positioning, all layout is done as if the positioned element
were in its static position (i.e. where it would have been if it hadn't
been positioned) and then the positioned element is moved *without*
reflowing anything. Negative margins, OTOH, *are* taken into account
during layout.

So in this case, the rendering engine correctly refuses to flow text into
the space that will be vacated when the image is moved by relative
positioning since that space won't be vacant until after the move is done.
With the negative margin, however, the space becomes available at the time
the text-flowing is being done and therefore the rendering engine, again
correctly, flows text into the space.
Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.