Z-Index和Positioning:使用' Particleground' Jquery插件

时间:2015-03-09 00:06:51

标签: javascript jquery html css jquery-plugins

我对z-index和定位感到困惑。我已经阅读过关于此的问题和文章,我一直在努力。

我正在尝试使用一个Jquery插件:'Particleground':https://github.com/jnicol/particleground/find/master

我已经使用了插件,我将粒子放在页面顶部。但是我的整个页眉都被推倒了,但我想让它出现在最顶层。请帮忙!

1 个答案:

答案 0 :(得分:0)

制作粒子容器:

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;