MAKING AN IFRAME TO RESIZE AUTOMATICALLY TO THE PAGE


/ Published in: HTML
Save to your folder(s)

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


Copy this code and paste it in your HTML
  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. }

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.