make an image and a paragraph sit next to each other

JamesTBennett picture JamesTBennett · Jun 24, 2010 · Viewed 68.5k times · Source

I have a box with an image and some txt and I want the txt to be horizontal to the image. I know this may be a pretty easy question but I can't seem to find a good answer on the interwebs. thanks for any help.

<div id='container'>
 <img src='someimage.jpg'/>
 <p>some text</p>
</div>

Answer

Rowland Shaw picture Rowland Shaw · Jun 24, 2010

Take a look at CSS's float property, for example:

<div id='container'>
 <img src='someimage.jpg' style='float: left;'/>
 <p>some text (that will now wrap around the image</p>
</div>