I'm using a javascript to resize an iframe relative to its content.
The goal is to display the content and using the scroll of the parent of the iframe only.
HTML
<div id="content">
<iframe name="tht" width="100%" src="path" onload='javascript:resizeIframe(this);'></iframe>
</div>
JAVASCRIPT
function resizeIframe(obj) {
obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px';
}
I want to have the same behavior without using javascript (only css).
I tried to use height="100%" but the scroll of the iframe appears.
Edit: I don't have a problem to use a javascript solution, but sometimes the iframe resizing takes a long time and sometimes the resizing doesn't work: there is no display.