我需要删除 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 许可协议
overflow 不是 HTML5 的解决方案,因为唯一错误支持它的现代浏览器是 Firefox。
当前的解决方案是将两者结合起来:
检查这个