0

Below is my code. I wished to wrap my text around the image. I used q {float: left; width: 100%}. However, the text appeared below the image.

<p class = "review">
  <img src="https://webster.cs.washington.edu/images/fresh.gif" alt="Fresh" />
  <q>TMNT is a fun, action-filled adventure that will satisfy longtime fans and generate a legion of new ones.</q>
</p>

Is there any other way to wrap my text around the image? Thank you!

Stickers
  • 75,527
  • 23
  • 147
  • 186
Lunana
  • 41
  • 1

5 Answers5

1

<p class = "review">
<img src="https://webster.cs.washington.edu/images/fresh.gif" alt="Fresh" style="float:left"/>
<q>TMNT is a fun, action-filled adventure that will satisfy longtime fans and generate a legion of new ones.</q>
</p>
mr. Holiday
  • 1,780
  • 2
  • 19
  • 37
0

Change the <q> display property to display:inline and remove the width property. That will align it next to the image

Ben Rondeau
  • 2,983
  • 1
  • 15
  • 21
0

You actually need to float the image left. That will cause the behavior you want - having the text wrap around the image.

Jonathan
  • 123
  • 1
  • 9
0

You can use span tages or use display:inline in your css:

Working demo

<span>Hello!</span><span><img src="https://webster.cs.washington.edu/images/fresh.gif" alt="Fresh" /></span><span>How are you!</span>
Prashant Ghimire
  • 4,890
  • 3
  • 35
  • 46
0

You want to float the image not q

.review {width:100%;}
.review img {float:left; margin:7px; vertical-align:top;}
<p class = "review">
<img src="https://webster.cs.washington.edu/images/fresh.gif" alt="Fresh" />
<q>TMNT is a fun, action-filled adventure that will satisfy longtime fans and generate a legion of new ones.</q>
  <q>TMNT is a fun, action-filled adventure that will satisfy longtime fans and generate a legion of new ones.</q>
  <q>TMNT is a fun, action-filled adventure that will satisfy longtime fans and generate a legion of new ones.</q>
</p>
Jon P
  • 19,442
  • 8
  • 49
  • 72