|
socks -> pictures with captions? (4/15/2004 17:38:28)
|
CSS novice here. Does anyone know a CSS method for inserting a picture, with caption underneath, into a block of unrelated text, like what you might see in a newspaper column? The problem is aligning the picture/caption block, then making the main text flow around it, similar to what happens when text flows around an aligned picture in HTML. Simple to do with a nested table, but I have been banging my head with CSS. I have been experimenting with DIV and SPAN tags, and the FLOAT property. Example: .leftpic {width:150px; text-align: center; font-size:8pt; padding:3px; border: 1px solid #666666; margin-top:5px; margin-right: 5px; float:left;} <span class=leftpic> <img src="xyz.jpg" width=150> Caption text goes here. It should appear directly under the picture, with a line break at 150px. A border encloses both picture and caption text, visually separating it from the main text, which should appear above, below and to the right of the border. </span> This works reasonably well for the first picture in the column, but subsequent pictures are each offset to the right of the previous one -- imagine a long, narrow newspaper column where all the pictures, instead of aligning vertically on the left, stagger down like a set of stairs. I believe this is a property of FLOAT. Seems like this would be a relatively common situation. Does anyone know a better way to do this? Thanks.
|
|
|
|