gpt4 book ai didi

html - 内容具有 overflow-x : hidden 的 iframe 的水平滚动条

转载 作者:太空狗 更新时间:2023-10-29 16:07:32 29 4
gpt4 key购买 nike

我正在处理一个宽度为 760 像素的着陆页,并且需要一个包含 980 像素宽内容(Flash 演示)的 iframe。所以我需要有一个水平滚动条才能查看全部内容。但是,无论我添加什么作为滚动属性(例如 scrolling="auto/yes"等),都没有任何反应 - 根本没有水平滚动条。

iframe中显示的页面在源代码中有如下命令:

body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
overflow-x: hidden;
}

据我了解,这就是为什么我的iframe中没有水平滚动条的原因。有什么解决方法吗?

最佳答案

您应该将 iframe 包裹在一个包含 div 中,将固定宽度应用于容器。

-

HTML

<div class="container">
<iframe></iframe>
</div>

-

CSS

.container {
width: 980px;
height: auto;
overflow: scroll;
-webkit-overflow-scrolling: touch;
}

关于html - 内容具有 overflow-x : hidden 的 iframe 的水平滚动条,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17109338/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com