Avoid 100vh On Mobile Web | chanind.github.io
Viewport units in CSS sound great. If you want to style an element to take up the full screen height, you can just set height: 100vh and voila - you have a perfect fullscreen element, which resizes as the viewport changes! Sadly, this is not the case. 100vh is broken in a subtle but fundamental way on mobile browsers that makes it nearly useless. It’s best to avoid 100vh and instead rely on javascript to set heights for a full viewport experience.
Viewport units in CSS sound great. If you want to style an element to take up the full screen height, you can just set height: 100vh and voila - you have a perfect fullscreen element, which resizes as the viewport changes! Sadly, this is not the case. 100vh is broken in a subtle but fundamental way on mobile browsers that makes it nearly useless. It’s best to avoid 100vh and instead rely on javascript to set heights for a full viewport experience. The core issue is that mobile browsers (I’m looking at you, Chrome and Safari) have a “helpful” feature where the address bar is sometimes visible a
Explore this link on the map →related reading
- <meta name="viewport"> HTML attribute value - HTML | MDNdeveloper.mozilla.org
- Animating height: auto — nemzes.netnemzes.net
- Web Interface Guidelinesvercel.com
- Cheng Lou on X: "My dear front-end developers (and anyone who’s interested in the future of interfaces): I have crawled through depths of hell to bring you, for the foreseeable years, one of the more important foundational pieces of UI engineering (if not in implementation then certainly at https://t.co/BKnwCDIp75" / Xx.com
- Transitions.dev — Essential transitions for web appstransitions.dev
- Using CSS Transitions on Auto Dimensions | CSS-Trickscss-tricks.com
- How we built the v0 iOS app - Vercelvercel.com
- Goethe’s Advice for Young Writers by Johann Peter Eckermanntheparisreview.org
- In Search of the Lost Trailtheparisreview.org
- The Best Way to Implement a "Wrapper" in CSS | CSS-Trickscss-tricks.com
- Fields – SOCKSsocks-studio.com
- Getting sticky with it — Troubleshooting CSS sticky positioning - DEV Communitydev.to