Posted By

jaff on 02/19/10


Tagged

iframe resize bar quirks digg


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

Priestd09


MAKING AN IFRAME TO RESIZE AUTOMATICALLY TO THE PAGE


 / Published in: HTML
 

URL: http://www.sitepoint.com/forums/showthread.php?t=633501

Remove the doctype and any xml namespace declarations from your header and quirks mode will take care of the rendering, additionally this fix is not compatible with IE8 rendering so we need to put IE8 in emulation mode

  1. <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
  2. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  3. <link rel="stylesheet" type="text/css" href="bar.css" />
  4. <title>Title of the document</title>
  5. </head>
  6. <div id="bar">bar content</div>
  7. <iframe id="frame" src="_" />
  8. </body>
  9.  
  10. *******
  11. CSS
  12. *******
  13.  
  14. body {
  15. padding: 0px;
  16. margin: 0px;
  17. }
  18.  
  19. #frame {
  20. border: none;
  21. width: 100%;
  22. height: 100%;
  23. }
  24.  
  25. #bar {
  26. height: 50px;
  27. border-bottom: 3px solid #000000;
  28. }

Report this snippet  

You need to login to post a comment.