我已经尝试过其他人说过的话,但似乎没有用。你可以自己编码吗?我真的很沮丧。
<a href="#computing" onclick="document.getElementById('MainBack').innerHTML = '<iframe src=\'test.html\'></iframe>'">Computing</a>
这是我想要的地方:
答案 0 :(得分:0)
使用像这样的CSS规则使iframe填充它的父级并且没有边框:
#MainBack iframe { width: 100%; height: 100%; border: none; }
Internet Explorer不尊重border
设置,因此您还需要在代码中设置frameborder
属性:
<a href="#computing" onclick="document.getElementById('MainBack').innerHTML = '<iframe src="test.html" frameborder="0"></iframe>'">Computing</a>
答案 1 :(得分:0)
HTML
<iframe src="" scrolling="no" frameborder="0" allowtransparency="true"></iframe>
CSS
border:none;
overflow:hidden;
width:450px;
height:35px;"
在IE中使用Allowtransparecy,否则你会看到与页面背景不同的背景。
编辑: 添加了转义版本
<a href="#computing" onclick="document.getElementById('MainBack').innerHTML = '<iframe src=\'http://www.google.com\' scrolling=\'no\' frameborder=\'0\' allowtransparency=\'true\'></iframe>'">Computing</a>
<div id="MainBack"></div>