css - 溢出:覆盖在 Firefox 中不起作用

标签 css firefox cross-browser properties overflow

在我的网站上,我需要使用 css 属性 overflow: overlay对于 <div> .

但是,它没有在浏览器中呈现,并且在 firebug 中检查 css 显示它甚至不存在,但它在 Chrome 中工作。我还没有测试过 safari。

我必须更改什么才能获得 overflow: overlay css 属性有效吗?

谢谢

最佳答案

溢出的可能值为:

visible
hidden
auto
scroll

参见 herehere用于讨论这些内容。

在不同的浏览器中使用任何其他值将产生不可预知的结果,因为它们以不同的方式处理不正确的值。

编辑:在评论之后,我设法找到了 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只是滚动条会出现在页面内容的顶部,不会占用布局空间。

参见 here for the discussion .

关于css - 溢出:覆盖在 Firefox 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8543664/

相关文章:

java - 从 spring Controller 返回 csv 文件时的奇怪行为

javascript - 如何跨域获取iframe contentWindow高度

javascript - Paper.js 事件行为因浏览器而异

css - AMP 故事禁用全屏模式

javascript - 根据先前计算的值计算出比率

html - 删除 <td> 之间的边框和空格,但保留 <tr> 和 2 列(每列 3 个单元格)之间

html - 死谷歌搜索提交按钮

javascript - getCompatedStyle 属性值

javascript - 我的 D3 图表的图例和轴/刻度标 checkout 现在 Firefox 中,但不是 Chrome

css - 15 像素处 Firefox 和 Chrome 中 Verdana 的字距错误