gpt4 book ai didi

javascript - 如何修改iframe滚动条?

转载 作者:太空宇宙 更新时间:2023-11-03 22:54:07 25 4
gpt4 key购买 nike

我正在尝试重制(http://dollarz.comli.com/testing/index2.html)https://www.seedlipdrinks.com/ 的设计结构.

所以我创建了一个带有 iframe 的页面。但是我的 iframe 滚动有问题,它与我试图匹配的设计不相似。

我试过使用 scrolling="no" 属性,但它完全禁用了滚动。

我希望 iframe 中的内容可以滚动,滚动条应该隐藏。有什么办法吗?

最佳答案

您链接的网站未使用 iframe 或任何类型的滚动容器。它基本上有一个不透明和固定的页眉和页脚 + 主要内容的边距。这就是使站点看起来包含在一个矩形中的原因,同时保留了使用窗口滚动条进行滚动的能力。复制效果的方法如下:

body {
background-color: white;
}

header {
position: fixed;
top: 0;
left: 0;
right: 0;
height: 50px;
background-color: white;
}

section {
padding: 50px 0; /* So the header/footer doesn't overlap the content */
background-color: #7fff7f;
margin: 0 50px;
}

footer {
position: fixed;
bottom: 0;
left: 0;
right: 0;
height: 50px;
background-color: white;
}

Demo here

关于javascript - 如何修改iframe滚动条?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39058443/

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