hi guys,
I am trying to make some iframes fit into a div with variable width. The iframe must have a margin, and using a padding in the parent div element is not an option.
Unfortunately, the width:auto for iframe gives a preset width, and does not behave like for the div elements.
As a result, the iframe always seem to resize its container.
See the testcases below :
This is how it behaves when a div contains a div with width:auto > that's the result I want to achieve with an iframe
<div style="width:100px;background-color:blue">Container<div style="width:auto;margin:10px;background-color:white">content</div></div>
This is how it behaves when a div contains an iframe with width:auto
<div style="width:100px;background-color:red">Container<iframe style="width:auto;margin:10px" src=""></iframe></div>
This is how it behaves when a div contains an iframe with width:100% (the container becomes too big)
<div style="width:100px;background-color:red">Container<iframe style="width:100%;margin:10px" src=""></iframe></div>
Any ideas ?
Thanks,
Yohann