iFrame-带页眉的整页

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了iFrame-带页眉的整页相关的知识,希望对你有一定的参考价值。

This code will allow you to have a full screen iframe with a header like a lot of sites do when navigating outside their site or featuring templates and things. Reference your CSS however you want. The html is necessary how it is, but add any additional code inside the header div.
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3.  
  4. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  6.  
  7. <title>Page with iFrame that FITS!</title>
  8.  
  9. <style type="text/css" media="screen">
  10. html, body {
  11. position: absolute;
  12. height: 100%;
  13. max-height: 100%;
  14. width: 100%;
  15. margin: 0;
  16. padding: 0;
  17. }
  18. iframe {
  19. position: absolute;
  20. height: 100%;
  21. width: 100%;
  22. border: none;
  23. }
  24. #container {
  25. position: absolute;
  26. top: 50px; /* Change with Height of #header */
  27. bottom: 0;
  28. width: 100%;
  29. overflow: hidden ;
  30. }
  31. #header {
  32. position: absolute;
  33. top: 0px;
  34. height: 50px; /* Change with top of #container */
  35. color: #eee;
  36. background-color: #ccc;
  37. width: 100%;
  38. }
  39. </style>
  40.  
  41. </head>
  42.  
  43.  
  44. <div id="header"></div>
  45. <div id="container">
  46. <iframe src="http://brandonbuttars.com"></iframe>
  47. </div>
  48.  
  49. </body>
  50. </html>

以上是关于iFrame-带页眉的整页的主要内容,如果未能解决你的问题,请参考以下文章

如何使QTextDocument适合打印机的整页宽度

Icefaces 1.8.2 中的整页刷新?

javascript 简单的整页

CSS 完美的整页背景图像

整页 <iframe>

Nuxt.js-如何使用单独的布局?