Html 在 iframe 中隐藏垂直滚动条

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/36333479/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 13:05:11  来源:igfitidea点击:

Hide vertical scrollbar in iframe

htmlcss

提问by Hrushi Patil

I need to remove vertical scrollbar in an iframe. I have tried using overflow: hidden;still not working. Please help.

我需要删除 iframe 中的垂直滚动条。我试过使用overflow: hidden;还是不行。请帮忙。

How it looks now

现在的样子

Code:

代码:

#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>

回答by Amitesh Kumar

overflow isn't a solution for HTML5 as the only modern browser which wrongly supports this is Firefox.

溢出不是 HTML5 的解决方案,因为唯一错误支持此功能的现代浏览器是 Firefox。

A current solution would be to combine the two:

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

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

iframe { overflow:hidden; }

check This

检查这个

回答by Dharmendra Bisht

I think it'll help please check below mentioned link:

我认为它会有所帮助,请检查下面提到的链接:

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

/*Mobile iframe CSS*/
iframe {
height: 100%;
width: 100%;
position: absolute;
top: 0;
margin: auto ;
left: 0;
border:none;
}
body{margin:0px;}

https://jsfiddle.net/xnt014a8/2/

https://jsfiddle.net/xnt014a8/2/

回答by Bomskie

you could try

你可以试试

iframe{scrolling="no"}