这个是在窄屏下显示正常,宽屏下右边有一个空白,显的很不协调
以下是html代码:
--%> --%>
回复讨论(解决方案)
宽度动态计算
你class给个菜单导航一个max-widht,别让他超出; 按道理来说你导航菜单给了固定值一般不会出现空白的 有可能是你其他样式的问题 。
我发现是右侧ifram宽度不能动态调整的原因,网上找了一些代码,不管用
window.onload = function() { var a = document.body.clientWidth - 195; //取得iframe框架的实际宽度// alert(a); //弹出数值测试 //document.getElementById("rightFrame").style.width = a + "px"; document.getElementById("rightFrame").style.width = a + "px"; }
问题解决了,代码贴出来,分享一下:
html代码如下,注意宽高要设为auto
输出至两个文本框 // document.form1.availHeight.value = winHeight; //document.form1.availWidth.value = winWidth; document.all("rightFrame").width = winWidth - 215; document.all("rightFrame").height = winHeight - 80; document.all("leftFrame").height = winHeight - 80;// alert(document.all("rightFrame").width +"-"+ winWidth); } findDimensions(); //调用函数,获取数值 window.onresize = findDimensions; //-->
查看更多关于iframe框架如何适应不同分辨率的浏览器_html/css_WEB-ITnose的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did107767