在我的网站上,我需要使用 css 属性 overflow: overlay
对于 <div>
.
但是,它没有在浏览器中呈现,并且在 firebug 中检查 css 显示它甚至不存在,但它在 Chrome 中工作。我还没有测试过 safari。
我必须更改什么才能获得 overflow: overlay
css 属性有效吗?
谢谢
最佳答案
溢出的可能值为:
visible
hidden
auto
scroll
在不同的浏览器中使用任何其他值将产生不可预知的结果,因为它们以不同的方式处理不正确的值。
编辑:在评论之后,我设法找到了 overflow:overlay here 的提及。 .
覆盖描述为:
Content is clipped and scroll bars are added when necessary.
重要的是,它还说只能在 Safari 或 Chrome(即 WebKit)中工作。
This item在 WebKit bugzilla 上,无论如何,这个世界都不长了:
WebKit currently has a proprietary CSS overflow value called "overlay" which is undocumented and as far as I can tell from reading the code works exactly like "auto".
We should either remove it or rename it to "-webkit-overlay".
2016 年 3 月更新
看起来像overflow: overlay
没有消失。有迹象表明它正在进入标准。
overlay
之间的区别和 auto
只是滚动条会出现在页面内容的顶部,不会占用布局空间。
关于css - 溢出:覆盖在 Firefox 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8543664/