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?

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.