I'm having trouble with vw
and vh
units on OSX Safari.
Take this code as an example:
<body style="margin: 0;">
<div style="background: red;
height: 100vh;
width: 100vw;"></div>
</body>
At 100% zoom, it works fine. However, if you zoom out, Chrome and Firefox (with this example) still render the red div
across the whole page. Safari, on the other hand, seems to be rendering as if vw
and vh
are calculated against the viewport at zoom 100%.
Is this the expected behaviour or is this something Safari does differently to other browsers? Are there any other browsers that render vw
and vh
in the same way?
As I know only Safari has Problems with recalculation. See this page for more known issues with this property: http://caniuse.com/#feat=viewport-units.
This was a bug in Safari, which was reportedly closed in November 2017. It's unclear if it will land in Safari 12 or not.
Bug: https://bugs.webkit.org/show_bug.cgi?id=145614
Changeset: https://trac.webkit.org/changeset/225277/webkit
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With