开发者社区> 问答> 正文

chrome中frame用css固定高度失败

我用frame做了个网页,希望在改变浏览器窗口大小时里面的frame高度不改变。
我是这么做的:

<frameset cols="*,1024,*" frameborder="NO" framespacing="0" style="margin:0px auto; height:650px;">
<frame src="about:blank">
    <frameset rows="100,500,50" frameborder="NO" framespacing="0" style="height:650px;">
        <frame src="/_component/banner.html" noresize="noresize" scrolling="no" style="height:100px;">
        <frameset cols="224,800" frameborder="NO" framespacing="0" style="height:500px;">
            <frame src="/_component/sidebar.php" noresize="noresize" scrolling="no" name="sidebar">
            <frame src="/_component/index.php" name="showframe" noresize="noresize" scrolling="no">
        </frameset>
        <frame src="/_component/footer.php" noresize="noresize" scrolling="no" style="height:50px;">
    </frameset>
<frame src="about:blank">
</frameset>

测试时,IE做到了固定frame高度,但是chrome无法实现。
求大神,这是怎么了???有辙吗?谢谢!

展开
收起
小旋风柴进 2016-03-12 12:56:54 2462 0
1 条回答
写回答
取消 提交回答
  • 外面得包一层页面,把下面代码存成另一个页面。在iframe中src地址改成frame做的网页

     <body style="margin: 0px;height: 650px;width:100%">
           <iframe src="frameset所在的页面地址.html"
                  style="height:100%;width:100%;border-width: 0px;">
           </iframe>
    </body>
    2019-07-17 19:00:40
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
零基础CSS入门教程 立即下载
低代码开发师(初级)实战教程 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载