Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add particle.js as a div background in bootstrap

please I would like to add a particle to a div section in bootstrap containing some text and typed.js text without my text disappearing, is this possible?

<div class="container text-center">
  <div id="particle-js">
    <h1 class="heading">
       TEXT
    </h1>
    <p>
      <span class="typing"></span>
    </p>
  </div>
</div>
like image 481
Laurent Avatar asked Jul 06 '18 10:07

Laurent


1 Answers

You can simply change the html layout so the particle-js div can be positioned as fixed or absolute and then give another div where your text would be placed on top of that.

<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;
}

Here is a very simple approach of that: https://jsfiddle.net/yrm4916s/

like image 99
John Baker Avatar answered Oct 31 '22 23:10

John Baker