position:固定在iframe里面

编程入门 行业动态 更新时间:2024-10-24 01:50:40
本文介绍了position:固定在iframe里面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

由于某些原因,如果我加载一个html页面,其位置:固定在某物上,但我加载到一个iframe,固定的位置似乎不渲染固定,但看起来更像绝对定位。

我不希望固定的div相对于父文档是固定的。我只是认为他们将固定在iframe。

解决方案

Chrome不存在修复 position:fixed if:

a)在元素中使用CSS3 transform, >

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

奇怪的是, ,但仍然开放: code.google/p/chromium/issues / detail?id = 20574

For some reason, if I load an html page that has position:fixed on something, but I load it in an iframe, the fixed positions to not seem to render as fixed, but look more like absolute positioning.

I'm not expecting the fixed divs to be fixed relative to the parent document. I would just think that they would be fixed in the iframe. Is this not possible in an iframe?

解决方案

Chrome has a bug that doesn't fix elements with position:fixed if:

a) you use CSS3 transform in any element, and/or

b) you have a child element positioned outside the box of it's parent element

Oddly enough, the bug was reported back in 2009 and it's still open: code.google/p/chromium/issues/detail?id=20574

更多推荐

position:固定在iframe里面

本文发布于:2023-11-26 08:08:47,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1633314.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:position   iframe

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!