iframe问题 怎么让iframe的height和width等于他的父级的height和width

图片说明
里面这个iframe的width和height怎么等于他父级的width和height 的100%求大神指教

这个简单。
在父页面
function iFrameHeight() {
var ifm= document.getElementById("mainwin");
var subWeb = document.frames ? document.frames["mainwin"].document : ifm.contentDocument;
if(ifm != null && subWeb != null) {
ifm.height=0

ifm.height = subWeb.body.scrollHeight;
}
}

        然后在iframe onload上onLoad="javascript:iFrameHeight();"
        就可以了,会自适应子页面的高度
 <iframe src="about:blank" style="width:100%;height:100%"></iframe>