ParticlesJS高度/仅特定div

时间:2018-08-28 09:58:31

标签: html css html5-canvas particles particles.js

我正在尝试将Particlejs画布限制为页面的一部分。我尝试手动将高度设置为无效。

Index.html:

            <div id="particles-js"></div>

        <div class="jumbotron jumbotron-fluid" id="jumbo">
            <div class="container">

                <h1 class="display-4">Test</h1>
                <p class="lead">This is a modified jumbotron that occupies the entire horizontal space of its parent.</p>
            </div>
        </div>

Index.css:

#particles-js {
  background: white;

  position: absolute;
  z-index: 0 !important;
}
#jumbo {

  background: rgba(255, 255, 255, 0.5);
}
canvas {
  display: block;
  position: fixed;
  z-index: -1;
}

0 个答案:

没有答案