Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 20th, 2005, 10:26 PM
Aaron
Guest
 
Posts: n/a
Default Text wrap around positioned float

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


  #2  
Old July 20th, 2005, 10:26 PM
Eric Bohlman
Guest
 
Posts: n/a
Default Re: Text wrap around positioned float

"Aaron" <agchandler@comcast.net> wrote in
news:ALednTGUV-gVOI3dRVn-ig@comcast.com:
[color=blue]
> 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?[/color]

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.
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles