simeydotme / sparticles

JavaScript Particles in Canvas ~~ Fast, Lightweight, High Performance.
https://sparticlesjs.dev
Mozilla Public License 2.0
251 stars 20 forks source link

Sparticles in absolute positione div #5

Closed Air-Sidney closed 3 years ago

Air-Sidney commented 3 years ago

How I understand Sparticles can calculate width and height of target div has absolute position. I can setup width in pixels but I need widht 100%, height 100%

simeydotme commented 3 years ago

https://github.com/simeydotme/sparticles#styling

.sparticles-container {
  position: fixed; /* or absolute */
  left: 0; right: 0;
  top: 0; bottom: 0;
  /**
   * z-index: -1; this makes the <body> still interactive 
   * by placing the sparticles behind the content
   */
  z-index: -1; 
}