Css 正确调整iframe的高度
我有以下代码:Css 正确调整iframe的高度,css,asp.net,asp.net-mvc,iframe,height,Css,Asp.net,Asp.net Mvc,Iframe,Height,我有以下代码: <iframe scrolling="no" src="http://www.portalminero.com/display/bols/Bolsa+de+Metales" style="border: 0 none; margin-left: 100px; height: 860px; width: 970px;"></iframe> 当我运行它时,我加载我想要的高度,但我不想显示页面的页眉。。。从Bolsa de Metales标题开始。。如
<iframe scrolling="no" src="http://www.portalminero.com/display/bols/Bolsa+de+Metales"
style="border: 0 none; margin-left: 100px; height: 860px; width: 970px;"></iframe>
当我运行它时,我加载我想要的高度,但我不想显示页面的页眉。。。从Bolsa de Metales标题开始。。如何才能做到这一点?如果加载的页面不在跨域的域中,那么使用CSS或JavaScript无法做到这一点。 一个简单的解决方案可以是添加一个白色背景的div,并使用css将其添加为顶层定位: HTML:
<div id="myDiv"></div>
<iframe id="myIFrame" scrolling="no" src="http://www.portalminero.com/display/bols/Bolsa+de+Metales"></iframe>
#myIFrame {
border: 0;
margin-left: 100px;
height: 860px;
width: 970px;
}
#myDiv {
background-color:#fff;
margin-left: 100px;
width: 970px;
height: 40px;
position: absolute;
}