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
  • 70,124
  • 20
  • 133
  • 171
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,750
  • 2
  • 18
  • 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,883
  • 1
  • 13
  • 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
  • 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 G
  • 4,820
  • 2
  • 34
  • 44
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
  • 18,133
  • 8
  • 47
  • 67