Having an issue with the particles.js library where the particles are displaying beneath the elements despite setting the Z-index. I have tried various solutions from CSS, Stack Overflow, Google, and YouTube but none have been effective.
Here is my code snippet:
// JavaScript code
const particlesJSON = {
"particles": {
...
[particle settings here]
...
}
}
particlesJS("sec", particlesJSON)
// Sample CSS Code
*{
margin: 0;
padding: 0;
height: 100vh;
}
.container{
max-width: 100%;
padding-left: 70px;
...
[more CSS styles here]
...
}
// HTML Structure
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Particles</title>
</head>
<body>
<section id="sec">
<div class="container">
<!-- Card components -->
<div class="row">
...
[card components structure]
...
</div>
</div>
</section>
<script src="https://cdn.jsdelivr.net/npm/particles.min.js"></script>
<script src="json-particles.js"></script>
// Bootstrap Javascript files
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
</body>
</html>