Jump to content

Float image with nothing underneath


mboehler3

Recommended Posts

Hi, I have a quick ? that I've never been able to figure out regarding floating images and CSS. I have multiple paragraphs of text on a page, and I would like to have an image float to the left. However, I would like the text to not flow underneath the image, instead looking much like two columns in a table. How can I create this effect in CSS without using a <table>? Here's an image of what my page looks like now:img-float-left.gifNow I'd like to have white space underneath the image, and have the text only appear to the right. Maybe I shouldn't even use the float property. Any suggestions?Thanks in advance!

Link to comment
Share on other sites

if you float the image left, and give the div a left-padding equal to the width of the image, you shouldn't have any problems.
I've tried adding this div tag around the image:
<div style="float:left;padding-left:359px;">

And it adds 359 pixels of white space to the left of my image, with text still floating underneath.I would guess that I could add padding-bottom:500px or some large number to add white space underneath the image, but I'd rather not do this since I'd have to change the number each time I add more text.

Link to comment
Share on other sites

no, the left padding goes on the div with the text. the idea is that the left padding pushes the text past the width of the floated image. For good measure try giving this text div a width.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...