Z-Index 和定位:项目在使用“Particleground”Jquery 插件时不断向下推

Z-Index and Positioning: Items keep pushing down upon use of 'Particleground' Jquery Plugin

本文关键字:插件 Jquery 下推 Particleground 定位 项目 Z-Index      更新时间:2023-09-26

我对z索引和定位有点困惑。我读过这方面的问题和文章,我一直在挣扎。

我正在尝试使用Jquery插件:"粒子地面":https://github.com/jnicol/particleground/find/master

我已经使用了该插件,并且正在页面顶部获取粒子。但是我的整个标题页面已被下推,但我希望它出现在顶部。请帮忙!

使粒子成为容器:

position: fixed;
top: 0;
left: 0;
height: 100%;
width: 100%;
z-index: 0;

和您的内容容器:

position: absolute;
top: 0;
left: 0;
width: 100%;
/* dont touch the height, it will adapt to the content */
z-index: 1;