Answer the question
In order to leave comments, you need to log in
How to put iframe full height on page without scrolling?
Hello!
How to put iframe full height on page without scrolling?
What would the iframe be as tall as the content.
Well, scrolled on the general page.
Give me an example.
Thank you.
Answer the question
In order to leave comments, you need to log in
Maybe I'm wrong (I don't know if it will work with <iframe>
, I haven't tried it). But such units as vh appeared in CSS
https://habrahabr.ru/post/126863/ , although I saw an article somewhere newer ....
I implemented this through Window.postMessage()
The site inside the frame reads its height using js and passes it to postMessage.
The site where the frame is embedded listens to the message and changes the height of the frame to the received value.
One feature: if the height of the site inside the frame can change, then for each change in height, you need to add a transfer of a new height value
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question