Hi!
I have a problem with aligning some divs in this case:
<div id="preamble" style="margin-bottom: 100px;">Preamble</div>
<div id="container" style="position: relative;">
<div id="content" style="position: relative; margin-top: 50px;">
Content
</div>
</div>
(Of course this is only an example that reproduces the behaviour I want to avoid.)
I would have expected the content-div to align from the container-div. Therefore there should be 150px alltogether between "Preamble" and "Content".
However, (at least in Firefox) this is not the case. The container-div is simply ignored and therefore the content-div's margin-top is ignored too, as long as it is not bigger than the margin-top of the preamble-div's margin-bottom.
What can I do? Is there an additional css-rule I would have to apply? I would like to keep position: relative aswell as the html-structure.
Thank you!
[edit2]
Hope you are still with me ;-)
Sorry for the delay... here's a live-demo. It's so live, I even did a small jquery-script to illustrate the problem - just try out the buttons. Live Demo
Thank you!
[edit]
The way it is:
The way I want it (without the borders)
I hope the difference is obvious although the images are jerky ;-)