CSS Help - Floating an image to the right.

rcktoo

Active Member
Joined
Mar 17, 2008
Messages
36
Reaction score
0
Hey

I'm having a bit of trouble with floating images and was hoping someone on the forum might be able to lend a helping hand.

I have an image that I have inserted between two paragraphs of text. I want to align this image to the right. I used the CSS float property but find that the text from the paragraph that sits below the right aligned image, sneaks up and wraps around.

Is there a property I can use to keep the text from wrapping around the floated right image?

15nax4m.jpg


Any help or advice would be appreciated.

Cheers
 
A link to the page online is necessary so that we can have a look at the code; otherwise please paste a copy of the html and css here.
 
Create a div below your image like so:

<div class="clear"></div>

then set it in your stylesheet like so:

.clear { clear: both; }
 
Hey

I'm having a bit of trouble with floating images and was hoping someone on the forum might be able to lend a helping hand.

I have an image that I have inserted between two paragraphs of text. I want to align this image to the right. I used the CSS float property but find that the text from the paragraph that sits below the right aligned image, sneaks up and wraps around.

Is there a property I can use to keep the text from wrapping around the floated right image?

15nax4m.jpg


Any help or advice would be appreciated.

Cheers

Using my space quest decoder, quick and dirty version.

Code:
<div>this is paragraph ontop</div>
<div style="min-width:500px">
   <div style="float:left;margin-right:10px" >this is text on left</div>
   <div style="float:left">this is picture on right</div>
</div>
<div style="clear:left"></div>
 
Top
Sign up to the MyBroadband newsletter
X