【问题标题】:How to add particle.js as a div background in bootstrap如何在 bootstrap 中添加particle.js 作为 div 背景
【发布时间】:2018-12-14 22:49:08
【问题描述】:

请问我想在引导程序中的 div 部分添加一个粒子,其中包含一些文本和 typed.js 文本,而我的文本不会消失,这可能吗?

<div class="container text-center">
  <div id="particle-js">
    <h1 class="heading">
       TEXT
    </h1>
    <p>
      <span class="typing"></span>
    </p>
  </div>
</div>

【问题讨论】:

    标签: javascript twitter-bootstrap particles typed


    【解决方案1】:

    您可以简单地更改 html 布局,以便将particle-js div 定位为固定或绝对,然后提供另一个 div,您的文本将放置在该 div 之上。

    <div class="container text-center">
      <div id="particles-js"></div>
      <div id="overlay">
        <h1 class="heading">
          TEXT
        </h1>
        <p>
          <span class="typing"></span>
        </p>
      </div>
    </div>
    
    
    #particles-js {
      background-color: #b61924;
      position: fixed;
      top: 0;
      right: 0;
      bottom: 0;
      left: 0;
      z-index: 0;
    }
    
    #overlay {
      position: relative;
      padding: 50px;
    }
    

    这是一个非常简单的方法:https://jsfiddle.net/yrm4916s/

    【讨论】:

    • 不起作用,我在哪里添加 css 在引导程序中
    • 不确定我是否理解这个问题,您可以在 CSS 文件中添加的 CSS 取决于您组织文件的方式。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-08-20
    • 2021-02-23
    • 1970-01-01
    • 2016-05-25
    • 1970-01-01
    • 2014-04-05
    相关资源
    最近更新 更多