Forum Moderators: not2easy

Message Too Old, No Replies

getting margin above or below floats

I need my space.

         

D_Blackwell

6:19 am on Dec 18, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've had a number of cases recently where I have floated columns left and right. The elements above or below don't want to accept a margin to back off these floats. The box border wants to ride right up to the floats.

I understand that the floats are removed from the document flow, but was hoping that {clear: both + margin-top: 2em;} would do the trick. The better browsers aren't buying it:)

My solution is probably not a good choice, so I need a better one. I have been adding
<p style="clear: both; height: 1em;"></p> between the floats and the next element. This solves my problem. What would less clumsy?

Do I put the floated columns in their own box? There isn't a pixel to spare.

DrDoc

7:33 am on Dec 18, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Why not just add a margin to the float box itself?