gpt4 book ai didi

css - 位置 :fixed inside of an iframe

转载 作者:技术小花猫 更新时间:2023-10-29 11:17:51 29 4
gpt4 key购买 nike

出于某种原因,如果我加载一个具有位置的 html 页面:固定在某物上,但我将其加载到 iframe 中,固定位置似乎不会呈现为固定位置,但看起来更像是绝对定位。

我不希望固定的 div 相对于父文档是固定的。我只是认为它们会固定在 iframe 中。这在 iframe 中是不可能的吗?

最佳答案

Chrome 有一个错误,它不会修复带有 position:fixed 的元素,如果:

a) 您在任何元素中使用 CSS3 转换,和/或

b) 你有一个子元素位于其父元素的框外

奇怪的是,该错误早在 2009 年就已报告,并且仍然存在:https://code.google.com/p/chromium/issues/detail?id=20574

关于css - 位置 :fixed inside of an iframe,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8304148/

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