在浏览器的滚动条上放置固定元素 [英] Placing a fixed element above browser's scrollbar

查看:321
本文介绍了在浏览器的滚动条上放置固定元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基本上,我想显示一个覆盖页面上所有内容的重叠式div,包括滚动条。



固定元素可能出现在上面页面的滚动条?我尝试将滚动条的z-index设置为-1,但显然不起作用。

解决方案

html元素无法通过浏览器chrome(滚动条等)呈现。



有关如何呈现页面的更多信息,请阅读本文 Web浏览器引擎



Z-index,较低的数字在具有较高数字的对象后面。或多或少,有关详情,请参阅 CSS规范


Basically, I want to show an overlay div that covers everything on the page, including the scroll-bars.

Is it possible for a fixed element to appear above the page's scroll-bars ? I tried setting the z-index of the scroll-bars to -1, but apparently doesn't work.

解决方案

No, html elements cannot render over the browser chrome (scroll bars, etc).

For more information on how pages are rendered, read this article Web Browser Engine

Also with Z-index, the lower numbers are behind objects with higher numbers. More or less, for more detail see the CSS spec

这篇关于在浏览器的滚动条上放置固定元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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