Previous Message
Next Message

Re: [css-d] stopping text wrapping under and image with CSS

Sent by Rijk van Geijtenbeek on 22 February 2002 07:07


On Friday, February 22, 2002, Gyrus wrote:

> Just curious about how to do a certain thing that I
> commonly use with tables but can't get my head
> round how to do the same with CSS...

> Say you've got an image with some text to the
> right of it. If I didn't want the text to wrap under
> the image, so both image and text are in their own
> 'columns', so to speak - with just whitespace under
> the image - using tables it would obviously be easy:

> <table>
>     <tr>
>         <td><img src="image.gif" /></td>
>         <td>Text...</td>
>     </tr>
> </table>

> How would you make the same thing happen with:

> <div class="imgText">
>     <img src="image.gif" />
>     <p>Text...</p>
> </div>

If you know the size of the image, say 100px:

div.imgText {padding-left: 120px;}
div.imgText img {float: left; margin: 0 10px;}


Greetings,
 Rijk                            [EMAIL-REMOVED]
(Opera Software employee)

Mot du Jour:
"Stupid" is a boundless concept.
Previous Message
Next Message

Message thread: