I have an iframe on my page and I need its height to be the height of the content inside it. The iframe source is on the same domain. I have a JS solution for this but I am looking for a CSS solution if possible. I searched a lot and couldn’t find a working solution.
<p>This is a sample paragraph.</p>
<p>This is a sample paragraph.</p>
<p>This is a sample paragraph.</p>
<p>This is a sample paragraph.</p>
<p>This is a sample paragraph.</p>
<p>This is a sample paragraph.</p>
<p>This is a sample paragraph.</p>
<p>This is a sample paragraph.</p>
<p>This is a sample paragraph.</p>
<p>This is a sample paragraph.</p>
Currently, the iframe on the page.html does not display the full content height of the iframe.html, it displays a vertical scrollbar.
Thanks for the reply. I would never ask a question here before spending hours on research. The code you provided makes the iframe cover the page 100%, which is not what I need. I just need the iframe to display its full height based on its content. Just like the one here: http://css-tricks.com/examples/iFrameResize/ . Which works fine but it is not CSS.