Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dynamic iframe height for Google Form

I wanted to know if it is possible to have a dynamic height (100%) of a Google Form iframe?

Especially, when your Google form extends to two or more pages.. is there a way to have it resize to 100% height instead of putting in heigh pixel?

Thanks

like image 403
Wasabi Developer Avatar asked Jul 20 '26 15:07

Wasabi Developer


2 Answers

The best way to embed a Google Forms iframe is to simply have a parent element that is 100vh. This way the iframe can measure it's required space vertically

<div style="height: 100vh;">
// Your embed code here with height and width set to 100%
</div>
like image 134
Alderias Avatar answered Jul 22 '26 06:07

Alderias


100% means that it will fill 100% of the height of it's parent element, if there isn't a higher parent element, it will be 100% of the height of the body

iframe {
 height:100%;
}

Although, I'm sure your question will turn out to be not as simple as first indicated

like image 39
adaam Avatar answered Jul 22 '26 05:07

adaam



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!