Link to home
Start Free TrialLog in
Avatar of jdana
jdanaFlag for United States of America

asked on

CSS - Best method to wrap text around an image

Take a look at image 1.  Here, I've done nothing but floated the image right:
img {
	float: right;
	display: block;
}

Open in new window

This is problematic because the text runs under the image.  Now, take a look at image 2.  Here, I've added some margin settings:
i
mg {
	float: right;
	display: block;
	margin: 100px 0 30px 30px;
}

Open in new window

This is better; the text no longer runs under the image, but the text also doesn't run above the image.  I'm trying to get the text to run above the image, but not under the image.  What's the best way to accomplish this?  The two samples are located here:

http://jaginc.com/dev/EEPostings/sample1.html
http://jaginc.com/dev/EEPostings/sample2.html
sample1.png
sample2.png
ASKER CERTIFIED SOLUTION
Avatar of Tom Beck
Tom Beck
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The second image is just doing what you told it to.  Try these settings instead.
img {
	float: right;
	display: block;
	margin: 0px 0px 10px 10px;
}

Open in new window

Avatar of jdana

ASKER

Thanks!