猿问
这样的页面第一次出现是页面填充满的,可是当页面缩小的时候,右边会有空白这个问题很不可思议
<div width="20%"></div>
<iframe name="iframename" style="width:80%;">
德玛西亚99
浏览 95
回答 2
2回答
慕哥6287543
你照我的做法试试: 1, function SetCwinHeight(obj) { var cwin=obj; if (document.getElementById) { if (cwin && !window.opera) { if (cwin.contentDocument && cwin.contentDocument.body.offsetHeight) cwin.height = cwin.contentDocument.body.offsetHeight; else if(cwin.Document && cwin.Document.body.scrollHeight) cwin.height = cwin.Document.body.scrollHeight; } } } 2,在iframe里面加上 onload="Javascript:SetCwinHeight(this)"试试。
0
0
0
慕后森
这样绝对可以: <body style="margin:0;padding:0;"> <div style="width:20%; height:20px; background-color:gray; float: left;"></div> <iframe frameborder="0" src="http://baidu.com/" style="width:80%; height:120px; float: right;"> </body>
0
0
0
随时随地看视频
慕课网APP
相关分类
JavaScript
我要回答