iframe

规定一个内联框架,被用来在当前HTML文件内嵌入另一个文档。
属性:
src:url,在iframe中显示的文档路径。
frameborder:是否显示边框。1:显示。0:不显示。
scrolling:滚动条控制。auto(内容超出边框自动显示滚动条),yes(出现滚动条),no(不出现滚动条)。
align:规定如何根据周围的元素来对齐iframe(嵌入的页面位置)。
值:left,right,top,bottom,middle。
注意:HTML5不支持,HTML4 01已废弃。(由于兼容性,align设置法不推荐)

  1. <iframe src="https://www.baidu.com" frameborder="0" scrolling="auto" align="middle"></iframe>



  1. *{
  2. margin: 0;
  3. padding: 0;
  4. }
  5. html,body{
  6. height: 100%;
  7. }
  8. header{
  9. width: 100%;
  10. height: 100px;
  11. background-color: #333333;
  12. color: white;
  13. font-size: 1cm;
  14. text-align: center;
  15. line-height: 100px;
  16. letter-spacing: 20px;
  17. }
  18. section{
  19. height: 100%;
  20. display: flex;
  21. }
  22. aside{
  23. width: 200px;
  24. height: 100%;
  25. background-color: olive;
  26. }
  27. aside ul li{
  28. height: 50px;
  29. text-align: center;
  30. line-height: 50px;
  31. }
  32. aside ul li:hover{
  33. background-color:olivedrab;
  34. }
  35. ul li a{
  36. display: block;
  37. height: 100%;
  38. color: white;
  39. text-decoration: none;
  40. }
  41. ul li a:focus{
  42. background-color: olivedrab;
  43. color: red;
  44. }
  45. main{
  46. /* width: calc(100% - 200px); */
  47. flex-grow: 1;
  48. background-color: #cccccc;
  49. }
  50. main iframe{
  51. width: 100%;
  52. height: 100%;
  53. /* border: none; */
  54. }
<header>页眉</header>
    <section>
        <aside>
            <ul>
                <li><a href="./html/manage.html" target="box">店铺管理</a></li>
                <li><a href="./html/contract.html" target="box">消费者权益保护</a></li>
                <li><a href="./html/protect.html" target="box">个人信息保护</a></li>
            </ul>
        </aside>
        <main>
            <!--
                可通过a的target取值与iframe的name值一致。实现将a标签的跳转网页显示在iframe中。
             -->
            <iframe src="./html/manage.html" frameborder="0" name="box"></iframe>
        </main>
    </section>