...

View Full Version : wrapping text



chump2877
07-15-2005, 08:36 PM
Seeing as how I appear to be braindead today, can someone please remind me how to wrap text inside a p tag around the left side of an image?

Thanks....

chilipie
07-15-2005, 09:24 PM
Well, if the image tag is inside the paragraph, you could float the image right:
p img {
float: right;
}If that's not what you wanted, just say :) .

chump2877
07-15-2005, 10:11 PM
Here's my HTML code:


<div>

<p class="content_p">blah text here

<img src="picture.jpg" class="picture">

</p>

</div>

My CSS:


.content_p
{
font-family:times new roman;
color:#000;
font-size:12px;
margin:0px;
}

.picture
{
margin-left:5px;
margin-bottom:5px;
vertical-align:text-top;
float:right;
}

The code doesn't work.... :(

chilipie
07-15-2005, 10:24 PM
Woops :o
p img {
display: block;
float: right;
}

chump2877
07-15-2005, 10:38 PM
That doesn't appear to work for me either...sigh

You can see the page here: http://www.mediamogulsweb.com/Demo_Site/index.php.

The source code is dynamically generated, so sorry if it's a little cluttered.....

The picture is of the computer (it's practically the only pic on the page right now....)

thanks.

_Aerospace_Eng_
07-15-2005, 11:07 PM
Its wrapping fine for me, but if you moved the image outside of the paragraph and float the image to the right it should also wrap. Of course the image would need to come before the paragraph.

chump2877
07-15-2005, 11:33 PM
if you moved the image outside of the paragraph and float the image to the right it should also wrap. Of course the image would need to come before the paragraph.

Thanks, aero, that worked for me....you da best :D

now tell me why on earth the image needs to come before the p tag ?? seems loony to me...but, again it worked, so who am i to complain.... :)

_Aerospace_Eng_
07-15-2005, 11:35 PM
Its almost like when you have a two column layout with the nav on the right and the content on the left. Naturally you would want to float the nav to the right but in order for this to work it needs to come before the content.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum