在 iframe 中隐藏垂直滚动条

新手上路,请多包涵

我需要删除 iframe 中的垂直滚动条。我已经尝试使用 overflow: hidden; 仍然无法正常工作。请帮忙。

现在的样子

代码:

 #iphone4 {
background-image: url("ipad_new2.png");
background-repeat: no-repeat;
height: 900px;
width: 750px;
margin: auto ;
position: relative;
overflow: hidden;
}

/*Mobile iframe CSS*/
iframe {
height: 700px;
width: 525px;
position: absolute;
top: 68px;
margin: auto ;
left: 61.99px;
overflow-y: scroll;

}

</style>
</head>
<body>
 <div id="iphone4" >
<iframe src="index_atish.html" seamless="seamless"></iframe>
</div>

</body>
</html>

原文由 Hrushi Patil 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 421
1 个回答

overflow 不是 HTML5 的解决方案,因为唯一错误支持它的现代浏览器是 Firefox。

当前的解决方案是将两者结合起来:

 <iframe src="" scrolling="no"></iframe>

iframe { overflow:hidden; }

检查这个

原文由 Amitesh Kumar 发布,翻译遵循 CC BY-SA 3.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题
logo
Stack Overflow 翻译
子站问答
访问
宣传栏