|
Posted by Ben C on February 14, 2008, 2:17 pm
Please log in for more thread options >> correction
>>
>> equalhalves div{width:50%; float:left}
>>
>><div class='equalhalves'>
>> <div> left column content here
>> </div>
>> <div>
>> right column content here
>> </div>
>> </div>
>> <p><a href="#top">(Back to top)</a> </p>
>>
>> How do I get a margin between the top div and the paragraph ?
>> I've tried adding margin they are all ignored
>
> You mean .equalhalves div.
>
> Anyway, just add
>
> .equalhalves { overflow: hidden }
>
> which makes it start a new block formatting context, putting its bottom
> edge below the floats. Then give the p margin-top of whatever you want.
> The bottom margin will now go between the top of the <p> and the bottom
> of the preceding <div> in the expected way.
Sorry I mean "The margin will now go between..."
|