Element A has a flexible and fixed position (at the top of the window) with a high z-index, allowing items below to pass underneath when scrolling.
Element B is positioned below Element A, and I want it to remain attached to the bottom of Element A while the height adjusts when resizing the window. The goal is to maintain a consistent margin between A and B.
I may have overcomplicated this issue, as the solution might be simple and right in front of me, yet I cannot seem to see it.
The HTML
<div id="A">
some content
</div>
<div id="B">
some content
</div>
The CSS
#A {
position: fixed;
z-index: 200;
width: 100%;
}
#B {
position: relative;
z-index: 100;
width: 100%;
}