首页 > 解决方案 > 如何将particles.js添加到布尔玛英雄背景?

问题描述

我得到了要加载的particles.js,但它会将bulma 英雄向上推,而不是替换英雄背景。有什么解决办法吗?

#particles-js{
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: linear-gradient(to bottom right, #ad5389, #3c1053);
}
<section class="hero is-fullheight" id="particles-js">
  <div class="hero-body">
    <div class="container has-text-centered">
      <h1 class="title has-text-light is-size-1">iOS application development</h1>
      <a class="button is-light is-inverted is-outlined">Learn More</a>
    </div>
  </div>
</section>

<script type="text/javascript" src="js/site.js"></script>
<script src="js/particles.js"></script>
<script src="js/app.js"></script>

标签: javascripthtmlcssbulmaparticles.js

解决方案


我用过:

#particles-js canvas{
  position: absolute;
  height: 100vh;
  z-index: -1;
}

推荐阅读