vh
/vw
with %
or px
units in Webflow layouts to ensure compatibility with Safari 5.1.Safari 5.1 has limited support for modern CSS units like vh
and vw
, which can cause layout issues in Webflow projects. Here's how to work around those limitations.
vh
and vw
, particularly:vh
includes hidden browser UI elements on mobile, creating miscalculations.vh
and vw
Where Possible%
) for sections and containers instead of viewport units.body
tag.vh
or vw
.tag to dynamically set height for affected elements:
document.documentElement.clientHeight
or window.innerHeight
to calculate height and apply with JavaScript.Head
section of Page Settings:@supports not (height: 100vh)
to assign alternate styles.<style>
in custom code.<style>
or <script>
inside an Embed element to override styles on specific elements.<body>
tag, then target that in your CSS.To work around vh
and vw
issues in Safari 5.1 in Webflow, replace viewport units with %
or px
, use JavaScript to dynamically set heights, and inject custom fallback styles using Webflow embeds or page settings. This ensures basic layout compatibility in older versions of Safari.