Important Caveat: YMMV on this trick. Matt himself notes that there are potential issues and there's a discussion with Šime in the comments which highlights actual problems in Chrome on Android. With that said, the whole "Safari ignores 100vh" issue is a pain and this is a simple workaround that may have some applications:
body { min-height: 100vh; /* mobile viewport bug fix */ min-height: -webkit-fill-available; }
Obviously, body
can be whatever element you want. The hope is that the -webkit
prefix here is good enough for all other browsers to ignore it. Whether or not that's true is, as I mentioned, debatable.