我的 Iframe 的水平滚动总是隐藏的,但我想在我的网页上看到它的 scroll-x。我不明白为什么 scroll-x 永远不会出现?确实出现了 scroll-y,但没有出现水平滚动条。
有什么建议吗?
<div class="row">
<div class="col-sm-8 col-sm-push-4">
<div class="embed-responsive embed-responsive-4by3">
<iframe class="embed-responsive-item" src="http://fr.lichess.org/training/29058" style="overflow-x: scroll;"></iframe>
</div>
</div>
</div>
最佳答案
相关样式/类溢出
在检查您的 <iframe>
目标的 CSS 之后, 它看起来像 <body>
似乎通过 overflow-x
明确限制了这一点属性如下所示:
另外,embed-responsive
以您的 <iframe>
为目标的类(class)也将限制它,因为它是 overflow
属性完全隐藏:
一个解决方案(如果你可以调整你的内页)
但是,如果您明确删除 overflow-x: scroll;
您的属性(property)<iframe>
它应该按预期工作并设置 overflow-x
内页上的属性到auto
:
/* Adjust this in your inner page (common.css, line 906) */
body {
/* Other styles omitted for brevity */
overflow-x: auto;
}
然后您应该会看到它按预期工作:
关于html - iframe水平滚动始终隐藏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36987510/