固定iframe中CSS的垂直位置 [英] fixed vertical positioning of css within an iframe
问题描述
我正在尝试使底部标头粘贴到iframe应用程序内部的屏幕底部,即使在页面滚动时也始终让用户看到它。我无法控制外部iframe,因为它位于其他域中。标头本身必须位于iframe内,因为我无法控制iframe之外。 iframe始终会扩展到其内容的高度,因此没有滚动条,但该条仍必须始终在视口中可见。
I am trying to get my bottom header to stick to the bottom of the screen inside of my iframe application and have it always appear in view for the user even when the page is scrolling. I have no control over the outer iframe as it is on a different domain. The header itself must be inside of the iframe as I have no control outside the iframe. The iframe always expands to the height of its contents so that it has no scrollbars, but the bar still has to be visible in the viewport at all times.
注意:iframe的高度应与其内容高度相同,因此不需要滚动条
Another thing to note: The iframe height should be the same height as its contents so their is no need for scroll bars
推荐答案
Chrome浏览器存在错误不能用 position:fixed
修复元素,如果:
Chrome has a bug that doesn't fix elements with position:fixed
if:
a)您在中使用CSS3转换任何元素,和/或
a) you use CSS3 transform in any element, and/or
b),您有一个子元素位于其父元素框的外部
b) you have a child element positioned outside the box of it's parent element
奇怪的是,该错误报告于2009年,但仍处于打开状态: https://code.google.com/p/chromium/issues/detail?id=20574
Oddly enough, the bug was reported back in 2009 and it's still open: https://code.google.com/p/chromium/issues/detail?id=20574
这篇关于固定iframe中CSS的垂直位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!