DEV Community

Discussion on: 100vh behavior on Chrome

Collapse
phyks profile image
Lucas Verney

Just came across this "bug" as well. For anyone coming across this article looking for solutions, there is actually a (closed) ticket on the Chrome issue tracker bugs.chromium.org/p/chromium/issue....

I managed to solve the issue by using percents rather than vh. body and html have 100% height and this percent height is defined to be the smallest viewport in Chrome (which is the viewport when the 56px navigation bar is shown) contrary to 100vh which is the largest viewport (when the navigation bar is hidden).

Not sure it'll work in all cases, but for my particular case it worked fine and seems more safe than handling this special case through browser hacks :)