You're seeing a small gap of background image below the fold on mobile browsers due to mobile viewport rendering inconsistencies, especially on iOS Safari. This usually occurs when using 100vh for height.
Since CSS solutions can be inconsistent, use JavaScript to calculate viewport height dynamically and apply it.
Create a custom height variable that calculates the effective viewport height:
Go to Page Settings > Before
tag, and paste:
const setVh = () => { document.documentElement.style.setProperty('--vh', window.innerHeight * 0.01 + 'px'); }; setVh(); window.addEventListener('resize', setVh);
Then, in Webflow Designer, use that in a custom style tag via Embed component or Site-wide CSS:
Add a class like .full-screen-fix
and apply:height: calc(var(--vh, 1vh) * 100);
Add a custom class to your section (e.g., hero-section
).
Add an Embed element on your page containing:
<style> .hero-section { height: calc(var(--vh, 1vh) * 100); } </style>
This ensures your section respects the actual visible height, avoiding scroll gaps.
Ensure there are no unintended margins or padding on your body or section elements that could create extra space.
Set Body
and html
to have:
Overflow: hidden
Margin and padding: 0
To fix extra space caused by background image rendering below the fold on mobile, avoid hardcoded 100vh, and instead dynamically calculate viewport height using JavaScript, then apply that using CSS (calc(var(--vh, 1vh) * 100)
). This results in a more reliable layout on mobile devices.