溢出:覆盖在firefox中不起作用。

时间:2022-08-23 14:44:12

On my website I need to use the css property overflow: overlay for a <div>.

在我的网站上,我需要使用css属性overflow: overlay for a

However, it is not rendering in the browser and an inspection of the css in firebug shows that it isn't even there, but it is as it works in Chrome. I havn't tested out safari.

然而,它不在浏览器中呈现,而在firebug中对css的检查显示它甚至不在那里,但它在Chrome中工作。我还没试过safari。

What must I change to get the overflow: overlay css property working?

要使溢出:叠加css属性生效,我必须更改什么?

Thanks

谢谢

1 个解决方案

#1


33  

Possible values for overflow are:

溢流的可能值如下:

visible
hidden
auto
scroll

See here or here for a discussion of these.

在这里或这里讨论这些。

Using any other value in different browsers will yield unpredictable results as they handle the incorrect value differently.

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

Edit: Following the comment, I've managed to find mention of overflow:overlay here.

编辑:在评论之后,我在这里找到了overflow:overlay。

overlay is described as:

覆盖被描述为:

Content is clipped and scroll bars are added when necessary.

内容将被剪切,必要时将添加滚动条。

Importantly its also said only to work in Safari or Chrome (ie WebKit).

更重要的是,它还说只能在Safari或Chrome (ie WebKit)中工作。

This item on WebKit bugzilla suggest it is not long for this world in any case:

这个关于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".

WebKit目前有一个私有的CSS溢出值叫做“叠加”,这个值是没有文档记载的,我从阅读代码中可以看出,它的工作方式和“自动”完全一样。

We should either remove it or rename it to "-webkit-overlay".

我们要么删除它,要么将它重命名为“-webkit-overlay”。

Update March 2016

2016年3月更新

Looks like overflow: overlay hasn't gone away. There are signs of it working it's way into the standards.

看起来溢出:覆盖层没有消失。有迹象表明,它正在朝着标准前进。

The difference between overlay and auto would only be that the scrollbars would appear over the top of the page content, and not cause it to take layout space.

叠加和auto之间的区别只在于滚动条会出现在页面内容的顶部,而不会占用布局空间。

See here for the discussion.

请看这里的讨论。

#1


33  

Possible values for overflow are:

溢流的可能值如下:

visible
hidden
auto
scroll

See here or here for a discussion of these.

在这里或这里讨论这些。

Using any other value in different browsers will yield unpredictable results as they handle the incorrect value differently.

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

Edit: Following the comment, I've managed to find mention of overflow:overlay here.

编辑:在评论之后,我在这里找到了overflow:overlay。

overlay is described as:

覆盖被描述为:

Content is clipped and scroll bars are added when necessary.

内容将被剪切,必要时将添加滚动条。

Importantly its also said only to work in Safari or Chrome (ie WebKit).

更重要的是,它还说只能在Safari或Chrome (ie WebKit)中工作。

This item on WebKit bugzilla suggest it is not long for this world in any case:

这个关于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".

WebKit目前有一个私有的CSS溢出值叫做“叠加”,这个值是没有文档记载的,我从阅读代码中可以看出,它的工作方式和“自动”完全一样。

We should either remove it or rename it to "-webkit-overlay".

我们要么删除它,要么将它重命名为“-webkit-overlay”。

Update March 2016

2016年3月更新

Looks like overflow: overlay hasn't gone away. There are signs of it working it's way into the standards.

看起来溢出:覆盖层没有消失。有迹象表明,它正在朝着标准前进。

The difference between overlay and auto would only be that the scrollbars would appear over the top of the page content, and not cause it to take layout space.

叠加和auto之间的区别只在于滚动条会出现在页面内容的顶部,而不会占用布局空间。

See here for the discussion.

请看这里的讨论。