1

我似乎无法找到一个明确的答案。

以下样式将从 Firefox 和 chrome 中的 iframe 中删除滚动条,但我似乎找不到 ie 的替代方法。我真的不想设置scrolling属性。有任何想法吗?

iframe
{
    height:500px;
    width:500px;
    overflow:hidden;
}

iframe::-webkit-scrollbar
{  
    display: none;
} 

编辑:我无法控制 iframe 源的 html。IE 可悲地意味着 ie7 向上。

4

1 回答 1

-1

这个技巧怎么样?(如果您只是不想显示滚动条)
<iframe>必须有一个容器。所以做这样的事情:

<container>
  <iframe src="http://www.domain.com"></iframe> 
</container>

还有你的 CSS:

container {
    width: 500px;
    height: 500px;
    overflow: hidden;
    position: relative;
}
iframe {
    width: 517px;  /* scrollbar = 17px */
    height: 517px; /* scrollbar = 17px */
    position: absolute;
    top: 0; left: 0;
}
于 2012-04-24T16:07:41.607 回答