tags:

views:

43

answers:

2

This is probably a simple question, but I can't figure it out. I would like to use CSS to put an image on the right side of a page and not wrap text around it. I would like it like this:

                ------------
                |    img   |
                |          |
                ------------
text text text text text text
text ....

If I do a float:right on the image, I get this:

text text text  ------------
text text text  |   img    |
text text text  |          |
text text text  ------------
text text text text text text
text ...

I could easily use tables to do this, but I would like pure CSS.

+3  A: 

Something similar to this should work:

<div>
  <div style="width: 100%">
    <img style="float:right;">
  </div>
  <div>
    text
  </div>
</div>
JungleFreak
Works like a charm! I knew it would be simple.
Starkey
+2  A: 
<div>
        <img src="img.jpg" style="float:right;" />
        <div style="clear:right;">
            <!-- text here -->
        </div>

</div>

perhaps?

Ross
This works too!
Starkey