I create a landing page where the user first sees the main area with the footer. Scrolling down shows that the footer is a sticky header, and I aim to use pure CSS to achieve this. To get a full-screen view of the main content and the footer, I set the property to heighttwo different values: 92% and 8% (use vhalso does not work). No matter what heightI specify in my CSS (different units and all), my footer divdoes not stick. As soon as I delete a property height, it works as expected.
Here is a screenshot of my page before deleting properties height:

, :

height :

:
html,
body {
height: 100%;
margin: 0;
}
#main {
height: 92%;
}
#landing {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
text-align: center;
}
#landingContent {
width: 20vw;
}
#footerNav {
height: 8%;
display: flex;
align-items: center;
position: -webkit-sticky;
position: sticky;
top: 0px;
}
<div id="main">
<div id="landing">
<div id="landingContent">
<h1 class="logo">Logo</h1>
<p id="landingParagraph">Lorem ipsum, paragraph content, etc etc.</p>
<button>Button</button>
</div>
</div>
</div>
<div id="footerNav">
<div id="footerNavContent">
<h1 class="logo">Logo</h1>
</div>
</div>
<p>Hello</p>
<p>Hello</p>
<p>Hello</p>
<p>Hello</p>
<p>Hello</p>
<p>Hello</p>
<p>Hello</p>
<p>Hello</p>
<p>Hello</p>
<p>Hello</p>
<p>Hello</p>
<p>Hello</p>
<p>Hello</p>
<p>Hello</p>
<p>Hello</p>
<p>Hello</p>
<p>Hello</p>
<p>Hello</p>
<p>Hello</p>
<p>Hello</p>
<p>Hello</p>
<p>Hello</p>
<p>Hello</p>
<p>Hello</p>
<p>Hello</p>
<p>Hello</p>
<p>Hello</p>
Hide result, overflow , , , height . , .
:
- Firefox 61 ( )
- Safari 53 (Tech Preview)
- Chrome 65
: ; height #main #footerNav .