I'm currently working on a layout where the header disappears when scrolled, but the navigation and footer stay fixed. You can view it here:
https://play.tailwindcss.com/LiIq5be2Wz?size=360x640
The same code is also available in jsfiddle: https://jsfiddle.net/cdxqsfu4/
Although I have managed to get it to work, the framework I am using requires an app
div. However, after adding it (or uncommenting it), only the top:0
property remains sticky, while left:0
does not. Any suggestions for fixing this?
UPDATE: The following specifications are essential:
- The scrollbar should cover the entire view, including the header and footer.
- When scrolling down, the header must disappear.
- The navigation bar should stick to the top-left corner of the screen at all times.
- The navigation bar should extend across the full width of the screen.
- The footer should remain fixed to the bottom-left corner of the screen.
- The footer should also span the complete width of the screen.
- The header should be positioned outside the
app
div.