"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.