我在我的页面中嵌入了一个 iframe,其中包含来自另一个站点的内容。如果您想访问它,这里有一个链接 http://8mags.com/bored/wtf/wtf01.html 问题是我无法删除滚动条和其他一些东西。 我的 CSS 代码在这里
html {
overflow-x: auto !important;
overflow-y: auto !important;
}
body {
overflow-y: auto !important;
background: white !important;
}
问题是滚动条仍然存在。而且 iFrame 中的背景没有变为白色。我还尝试用这段代码隐藏一些细节
.quote-subtitle {
display: none !important;
}
但它也不起作用。
编辑
生成iFrame的代码就是这个
<span class="quora-content-embed" data-name="What-are-some-of-the-most-awesome-psychological-facts/answer/Arjun-Subramaniam/quote/2114886">Read <a data-width="541" data-height="893" class="quora-content-link" href="http://www.quora.com/What-are-some-of-the-most-awesome-psychological-facts/answer/Arjun-Subramaniam/quote/2114886" data-embed="nqjyswb" data-type="quote" data-id="2114886" data-key="78561af9adeb1d847ceae88107798254">Quote of Arjun Subramaniam's answer to What are some of the most awesome psychological facts?</a> on <a href="http://www.quora.com">Quora</a><script type="text/javascript" src="http://www.quora.com/widgets/content"></script></span>
最佳答案
<body class=" logged_out" style="overflow: hidden;">
我在链接上使用它并工作,并隐藏了滚动条。 或者使用它来访问 iframe 的内容
$('#iframe').contents().find('body').css('overflow','hidden');
关于html - 无法在 iframe 中隐藏滚动条?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27031564/