【问题标题】:Webkit: Hide vertical scrollbar. Works in Chrome & Safari not in Firefox [duplicate]Webkit:隐藏垂直滚动条。适用于 Chrome 和 Safari 而不是 Firefox [重复]
【发布时间】:2013-01-16 01:11:30
【问题描述】:

可能重复:
Hidden scrollbars in Firefox (allows scrolling but just no scrollbar)

这在 Chrome 和 Safari 中运行良好:

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

但垂直滚动条在 Firefox 中不会隐藏。

我无法更改 iframe 代码,因此需要纯粹使用 CSS。

更新:我在上面添加了以下内容来解决问题。两个块都是必需的:

iframe
{  
    overflow: hidden;
}

但是,这种方法可能会限制我在其他地方精细控制 x 或 y 滚动条的能力。

哦,好吧。

【问题讨论】:

  • 您告诉我要隐藏 scrollbar 只对 safari 和 chrome。对 mozzila 使用 -moz- 前缀或不使用前缀
  • 之前有人问过这个问题...stackoverflow.com/questions/5820304/…
  • @morpheus 你是说这个吗:iframe::-moz-scrollbar { display: none; } 因为这并不能解决问题。
  • @Buggabill 谢谢,但答案不在那里。如上所述,我无法向 iframe 添加类或包装器。
  • @Buggabill 不要将问题标记为重复。当您回答问题不同时,我很早就提到过。

标签: css


【解决方案1】:

这应该会有所帮助:

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

<iframe src="http://microsoft.com" class="noscroll" scrolling="no"></iframe>

【讨论】:

  • 如上所述,我无法将类添加到 iframe 代码中。
猜你喜欢
  • 2010-12-14
  • 1970-01-01
  • 2011-03-11
  • 2013-02-12
  • 2018-08-17
  • 2013-10-26
  • 2020-01-13
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多