Reputation: 77
hope you can help me
I'm trying to create a newssite
I want to add an image in a div to my text. I want the text on the left and the image on the right. So when the text is longer then the image the text will fill the whole content page.
Hope you understand what i mean
Upvotes: 0
Views: 39
Reputation: 3604
You want to add the float:left; and float:right to your CSS properties.
Here's a fiddle that displays this: http://jsfiddle.net/MathiasaurusRex/3W256/
You wrap your < img > within your < p > tags and float each tag whichever way you want it.
CSS
p{float:left;}
img{float:right;}
HTML
<div>
<p> <img src="http://lorempixel.com/400/200/"/>"But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness."</p>
</div>
Upvotes: 1