Reputation: 51
I try to put a picture in the right side of the page. the problem is that there is a text near it, and in some browsers the picture hide the text. I use the next CSS for the <img>
attribute:
.imgP
{
position:relative;
top:10px;
right: 10px;
float:right;
}
the text is the next element:
<p> bla bla bla... </p>
How can I change it, in order that the text would move automatically near the picture?
Upvotes: 0
Views: 84
Reputation: 10772
What I think you're trying to achieve it text-wrapping on an image.
The principle for doing this is simple.
Create some HTML markup like this:
<img src="myimage.jpg" alt="" class="imgP" />
<p>My Paragraph text which will wrap around the image...</p>
And to make the text wrap the image, you simply float the image to the right:
.imgP
{
float: right;
}
A float will cause the horizontal spacing that the image sits on to collapse, and cause the text to fill that area.
Upvotes: 1