Advertisement

前端HTML中iframe的基本用法

阅读量:

下面提供了一个较为复杂的 <iframe> 示例,用以说明如何实现外部页面的加载、样式控制以及与 <iframe> 内部文档之间的交互方式:

复制代码
    <!DOCTYPE html>
    <html>
    <head>
      <style>
    .iframe-container {
      position: relative;
      width: 100%;
      height: 500px;
    }
    
    .overlay {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-color: rgba(0, 0, 0, 0.5);
      display: flex;
      justify-content: center;
      align-items: center;
      color: #fff;
      font-size: 24px;
    }
      </style>
    </head>
    <body>
      <div class="iframe-container">
    <ifr

全部评论 (0)

还没有任何评论哟~