2014-05-20 43 views
1

我用我的HTML5.In IFRAME ,如果我用SCROLLING =「無」我的瀏覽器(Chrome),支持它。但是一些網站說,滾動屬性在HTML5.And不支持我決定用css但溢出:隱藏;溢出 - X:隱藏;溢出 - Y:隱藏任何它不會影響任何東西。我該怎麼辦?我應該繼續使用滾動=「否」因爲它仍然可用於HTML5如何使用css隱藏iframe中的滾動條?

+2

你應用'溢出:hidden'風格在父頁或子頁? – Robbert

+0

在我使用* iframe *標籤的頁面中。 –

+0

可能重複的[如何刪除iframe的滾動條?](http://stackoverflow.com/questions/4460844/how-to-remove-iframes-scrollbars) – agrm

回答

0

要隱藏滾動條,您需要向iframe添加滾動屬性。

<iframe id="myiframe" src="http://www.cnn.com" style="width:200px;height:200px;" scrolling="no"/> 
+0

但我想這樣做使用css –

+0

滾動attr不支持HTML5 –

+0

但仍然可以使用它 –

0

CSS:

<style> 
    .restricted{width:200px; height:200px; overflow-y: hidden;} 
</style> 

的iframe:

<iframe src="http://cnn.com" class="restricted" scrolling="no"></iframe>