Skip to content

Instantly share code, notes, and snippets.

@mkormendy
Last active January 21, 2016 05:34
Show Gist options
  • Save mkormendy/0dc2769a905492c87f6a to your computer and use it in GitHub Desktop.
Save mkormendy/0dc2769a905492c87f6a to your computer and use it in GitHub Desktop.
Mobile sticky nav header that scrolls with nav items that vertically extend beyond the screen length.
header {
position: fixed;
z-index: 10;
width: 100%;
padding: 0;
}
header.scroll {
height: 100vh;
overflow-y: scroll;
}
@mkormendy
Copy link
Author

This is nice because vh is generally supported in the most used browsers on mobile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment