I am creating an application and I would like the navigator to be attached to the bottom of the browser. I have something like
<div style="display: flex; flex-direction: column; height: 100%"
<header>Header</header>
<section style="height: 100%">Main Content</section>
<footer>Sticky footer</footer>
<div>
This works great for the desktop. Here is a simple example where the red headline, yellow is the footer, blue is the content.
However, in iOS Safari (and some Android browsers, which I think also), when you scroll, the toolbar at the bottom closes 44 pixels below.
I read here some more about workarounds, but no real “good” solution. However, it seems like the Instagram site on iOS solved this:
Without scrolling:
When scrolling the lower navigation add-ons above the toolbar:
- , Instagram. , CSS ( CSS + JS). - , Instagram? Safari iOS .
: , .
<!DOCTYPE html>
<html style="height:100%"lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body style="height:100%; padding: 0; margin: 0">
<div style="display: flex; flex-direction: column; height: 100%">
<header>Header</header>
<div>
<div>Main content</div>
</div>
<footer style="position: fixed; bottom: 0; width: 100%">Sticky footer</footer>
</div>
</body>
</html>