I’m using the instructions here: https://developer.mozilla.org/en-US/docs/Web/CSS/Layout_cookbook/Sticky_footers
I’m expecting that the footer will stick to the bottom of the viewport even when the user scrolls. If there isn’t much content in the middle row, it will still stick. But I don’t see that functionality in the desktop browser; the footer is either high with little content, or it rolls down with long content.
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<style>
body {
margin: 0; /* prevents scrollbars */
}
#app {
min-height: 100%;
display: grid;
grid-template-columns: 1fr;
grid-template-rows: 1fr auto 1fr;
grid-template-areas:
'header'
'main'
'footer';
padding: 1em;
}
.header {
grid-area: header;
background-color: yellow;
height: 3em;
overflow: auto;
}
.main {
grid-area: main;
padding: 15px 5px 10px 5px;
}
.footer {
grid-area: footer;
background-color: orange;
height: 3em;
}
</style>
<div id="app">
<div class="header">this is the header</div>
<div class="main"></div>this is the countdown, Main<br><br>Did not work: https://css-tricks.com/how-to-use-css-grid-for-sticky-headers-and-footers/
<br><br>Did not work (this code is shown): https://developer.mozilla.org/en-US/docs/Web/CSS/Layout_cookbook/Sticky_footers
<br><br><span style="font-size: 24px">
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos t dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolo</span></div>
<div class="footer">this is the footer</div>
</div>
</body>
</html>