paint-brush
The Secret Trick For Mobile Viewportsby@torbet

The Secret Trick For Mobile Viewports

by Guy TorbetMay 5th, 2021
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Using the vertical viewport on mobile is shit. Here's a quick guide on how to make them less awful. Use webkit to fill the space of the green arrow in the viewport. Use a resize event listener to change the size of your vh variable. It will keep your sizing consistent, even when the window size changes. It's consitent across desktop and mobile, and a real time saver! I use this whenever I need to set an elements vh, it's a real-time saver.
featured image - The Secret Trick For Mobile Viewports
Guy Torbet HackerNoon profile picture
Guy Torbet

Guy Torbet

@torbet

L O A D I N G
. . . comments & more!

About Author

Guy Torbet HackerNoon profile picture
Guy Torbet@torbet

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite