position:固定在iframe里面 [英] position:fixed inside of an iframe

查看:441
本文介绍了position:固定在iframe里面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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



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

解决方案

Chrome不存在修复 position:fixed if:



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

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



奇怪的是, ,但仍然开放: https://code.google.com/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: https://code.google.com/p/chromium/issues/detail?id=20574

这篇关于position:固定在iframe里面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆