Posted by Ben C on 01/03/08 22:26
On 2008-01-03, Fister <nej@tak.dk> wrote:
> I'd like for the div.something-else below the three columns to be placed
> 25 pixels below the coloumn with the longest text. Unfortunately with the
> code below it only relates to the center-column. That causes problems if
> the text in left- or right-column are long. How can I fix this?
Put another div around #something-else, with clear: both and
padding-top: 1px set on it.
Then set margin-top on something-else to only 24px (because of the 1px
of padding).
[...]
Like this:
<div style="clear: both; padding-top: 1px">
> <div id="something-else">
> something else something else something else
> </div>
</div>
You need the other div (rather than just setting clear on
something-else) because otherwise its 25px margin-top is absorbed by the
clearing offset.
Padding-top of 1px prevents margin collapsing between the new div and
#something-else.
[Back to original message]
|