jquery - 将粒子背景作为页面的背景

标签 jquery html css

好的,所以我将使用 particleground( https://github.com/jnicol/particleground ) 作为页面的背景。

我已经添加了粒子地面,但是,它出现在页面所有内容的上方。 有点像这样:- enter image description here

我该怎么做才能将其作为背景? 这是代码的一部分。

<body>

    <?php include 'nav.php'; ?>

    <div class="container-fluid">
        <div id="particle">
                    <div class="row">
                            <div class="col-md-3 col-sm-12 col-xs-12">
                                <img src="images/logo.png">
                            </div>
                            <div class="col-md-6 col-sm-12 col-xs-12">
                            <div class="college_name">
                                IEC  College of Engineering and Technology
                                <br>
                                presents
                            </div>
                            </div>
                        </div>
                        <br>
                        <br>
                    <div class="row">
    ........

最佳答案

为了解决这个问题,我在内容后面写了粒子 ID。例如,如果我有这个:

<div class="title">
 <p>Title</p>
</div>
<!-- Calling the particle after the content, so it will be behind the content. 
-->
<div id="particles"></div>

还要确保在 CSS 中放置一个 id #particles 并声明 at 的宽度和高度为 100%。例如:

#particles {
  width: 100%
  height: 100%
  position: fixed;


}

关于jquery - 将粒子背景作为页面的背景,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35602219/

相关文章:

javascript - 为 RichTextArea : what is #document? 生成的 HTML

javascript - 我如何单击屏幕上的任意位置(除了目标 div 之外)以使所有内容返回到其原始位置

html - 外部 div 匹配内部 div 的宽度

jquery marginTop 无法正常工作

javascript - jQuery : update css on one table column based on attribute of another column

jquery - 透明的 css 边框作为占位符

JQuery - 将 CSS 更改应用于类的单个元素

javascript - 是否可以将 JavaScript/jQuery 图片库转换为 .Swf 格式?还是进入其他 "non-browser"介质?

javascript - Jquery 如何计算来自不同 div 的复选框

html - 构建小部件 (HTML/CSS)——表格还是 div?