html - 结合了 iframe 和页脚的 Bootstrap 模板

标签 html twitter-bootstrap css iframe

我的网站有一个标准的页眉、内容和页脚区域。我想要完成的是使我的 iframe 高度达到其容器的 100% 但是,我遇到的问题是 Bootstrap 粘性页脚工作所需的 css。

任何想法都会很棒!

fiddle

 <div id="wrap">
    <div id="content">
      <iframe src="https://jsfiddle.net/" height="100%" width="100%" style="height:100%;width:100%;">    
      </iframe>
    </div>
    <div id="push">   
    </div>
  </div>
  <footer id="footer">my footer</footer>

html,
body {
    height: 100%;
    /* The html and body elements cannot have any padding or margin. */
}

#content {
  height: 100%;
}

/* Wrapper for page content to push down footer */
#wrap {
    min-height: 100%;
    height: auto !important;
    height: 100%;
    /* Negative indent footer by it's height */
    margin: 0 auto -60px;
}

/* Set the fixed height of the footer here */
#push,
#footer {
    height: 60px;
}
#footer .container {
    border-top: 1px solid #dededd;
}

最佳答案

如果我没有正确理解您的意思,请试一试。

fiddle :https://jsfiddle.net/ex0Loy0t/2/

HTML:

  <div id="wrap">
    <div id="content">
      <iframe src="https://jsfiddle.net/" height="100%" width="100%" style="height:100%;width:100%;">    
      </iframe>
    </div>
    <div id="push">   
    </div>
  </div>
  <footer id="footer">my footer</footer>

CSS:

html,
body {
    height: 100%;
    /* The html and body elements cannot have any padding or margin. */
}

#content {
  height: 100%;
}

/* Wrapper for page content to push down footer */
#wrap {
    min-height: auto !important;
    height: 100%;
    /* Negative indent footer by it's height */
    margin: 0 auto 60px;
}

/* Set the fixed height of the footer here */
#push,
#footer {
    height: 60px;
    background-color: #000;
    color: #fff;
}
#footer .container {
    border-top: 1px solid #dededd;
}

关于html - 结合了 iframe 和页脚的 Bootstrap 模板,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36872354/

相关文章:

html - CSS:悬停显示 block 不起作用

HTML Material 设计按钮

css - 三个div的对齐方式

twitter-bootstrap - 集成 css 框架仅在指定类或 id 中工作

html - 为什么 6 个盒子中有两个盒子对齐不正确?

css - 为什么第一节元素似乎包含在第 n 个子 sibling 计数中?

html - HTML 编辑器中的换行符在网站中留出空间

java - Struts 1.x升级

javascript - 固定 header 在滚动时在 iPhone 包装器中向下移动

jquery - 如何使图像 slider 自动播放?