Jump to content

floating an image so text wraps around it.


deansaddigh

Recommended Posts

as above.

 

Here is my css code:

 

img.floatLeft { 
    float: left; 
    margin: 4px; 
}

 

here is my html/php

 

echo '<p>';
				echo $productdescription = $row['ProductDescription'];
			echo '</p>';



			$imagename = $row["ImageName"];
			$imagepath = $row["ImagePath"];
			$file = $imagepath.$imagename;


			echo 'Hover over image to enlarge';
                echo '<td><img src="'.$file.'" class="floatLeft" data-zoomsrc="'.$file.'" width="200" height="200"/></td>';?>
        		 		

 

 

Basically i want the image to float to the left of the product description but its not working any ideas?

Link to comment
Share on other sites

Your image file needs to be before any of the text you want to have wrap around it. When an item is floated its positioned within the normal flow, then taken out and repositioned.  Anything coming before the floated item will have an effect especially when floating to the left.

 

Your CSS looks fine.  Just move your image to the begining of the text and all should be good.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.