Likeless
05-07-2008, 03:43 PM
Hello :)
I've been using tables for HTML layout for years, and I'm trying to move into CSS layout, but I'm stumbling over what I'm sure are very basic issues.
On this page you can see my problem in action. Each of the yellow blocks with a card picture is a div with float:left. It contains two more float:left divs: one for the image and one for the text:
http://www.blackborder.com/cgi-bin/bbvid/index.cgi?action=vid_single&vid=5
Now, if you stretch and squish the page, you see that there's a point at which the text falls below the card image. This is what I wish to prevent. I would like the yellow containing blocks to drop down to the next line when they run out of space, not rearrange their contents.
I know two ways I could achieve this effect:
1) I could make an HTML table inside the containing div and put the image in a left cell and the text in the right cell.
2) I could give the containing div a fixed width, but this would mess with the text, which would not always fit properly in the fixed space.
I tried a few positioning properties, but they didn't work. Is there an easy way to achieve this without using tables?
I've been using tables for HTML layout for years, and I'm trying to move into CSS layout, but I'm stumbling over what I'm sure are very basic issues.
On this page you can see my problem in action. Each of the yellow blocks with a card picture is a div with float:left. It contains two more float:left divs: one for the image and one for the text:
http://www.blackborder.com/cgi-bin/bbvid/index.cgi?action=vid_single&vid=5
Now, if you stretch and squish the page, you see that there's a point at which the text falls below the card image. This is what I wish to prevent. I would like the yellow containing blocks to drop down to the next line when they run out of space, not rearrange their contents.
I know two ways I could achieve this effect:
1) I could make an HTML table inside the containing div and put the image in a left cell and the text in the right cell.
2) I could give the containing div a fixed width, but this would mess with the text, which would not always fit properly in the fixed space.
I tried a few positioning properties, but they didn't work. Is there an easy way to achieve this without using tables?