To ensure a div element matches the full height of the HTML document in Webflow, even after exporting the code, you need to anchor it to the document height using custom styles.
100vh to match the viewport height in Webflow. However, this matches only the visible screen, not the full scrollable document.100vh.
height: 100% with Full Document ContextTo match the document height (including scroll), you need to ensure the parent structure allows it.
height: 100% doesn’t work unless all parent elements support it.<style> tag or external CSS):html and body have height: 100%.min-height: 100% or height: 100%, depending on layout.
Example styles to include after export:
html, body {
height: 100%;
margin: 0;
}
#your-div-id {
min-height: 100%;
}(Replace #your-div-id with your div’s actual ID or class.)
If the document height changes dynamically (e.g., due to added content), use light JavaScript to update the div.
<script> tag at the bottom of the exported HTML:document.addEventListener("DOMContentLoaded", function() {
var docHeight = Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
document.getElementById("your-div-id").style.height = docHeight + "px";
});
To make a Webflow div match the full document height after export, give html and body height: 100%, then set your div’s height with CSS or JavaScript. Use 100vh for viewport height and JS if the document height is dynamic.