获取iFrame到网站的全宽(不是内容!)

时间:2014-11-04 10:33:25

标签: html css iframe

我的iframe代码如下:

<style type="text/css">
#left {
display: none;
float: left;
width: 212px;
}
#right {
display: block;
float: right;
width: 100%;
}</style>
<div align="left">
<iframe height="1000" src="https://secure.workbooks.com/process/=YjN4gDN/case_portal" width="2000"></iframe></div>

但是我想将iFrame区域扩展到页面的整个宽度,因此它填充了以下区域:

full width image

如果我只是增加iframe的宽度,我最终得到以下内容:

current issue

如何在不遇到第二个图像问题的情况下实现第一张图像?

您可以看到该页面 - here

1 个答案:

答案 0 :(得分:0)

首先,将#content-sub的宽度增加到100%(现在为960px;您的框架是其中一个子框架,因此要将其拉伸到最大宽度,您必须将父节点拉伸一样的方法)。其次,更改iframe如下: <iframe height="1000" src="https://secure.workbooks.com/process/=YjN4gDN/case_portal" style="width:100%"></iframe>