Reputation: 20011
How can we make image show on right side of the paragraph where <p>
i tried but it is always coming under <p>
example on fiddle http://jsfiddle.net/ECEka/44/
<div class="service-list">
<p>text goes here text goes heretext goes heretext goes heretext goes heretext goes here
text goes here text goes heretext goes heretext goes heretext goes heretext goes here</p>
<p>text goes here text goes heretext goes heretext goes heretext goes heretext goes here
text goes here text goes heretext goes heretext goes heretext goes heretext goes here</p>
<img src="https://www.google.co.in/images/srpr/logo4w.png" alt="icon" width="200" height="auto" />
</div>
Upvotes: 1
Views: 546
Reputation: 115278
You would have to put the image inside the p
tag (at the top) and then float it right.
HTML
<div class="service-list">
<p>text goes here text goes heretext goes heretext goes heretext goes heretext goes here
text goes here text goes heretext goes heretext goes heretext goes heretext goes here</p>
<p>
<img src="https://www.google.co.in/images/srpr/logo4w.png" alt="icon" width="200" height="auto" />text goes here text goes heretext goes heretext goes heretext goes heretext goes here
text goes here text goes heretext goes heretext goes heretext goes heretext goes here</p>
</div>
CSS
.service-list {
width: 600px;
margin-left:0px;
padding-left:0px;
display: block;
background-color:yellow;
}
.service-list p img {
float:right;
}
.service-list p {
text-align: left;
display:block;
padding: 0;
}
Upvotes: 0
Reputation: 1542
Change the order of html: put <img>
before <p>
;
Is that what you're looking for?
Upvotes: 4