簡體   English   中英

particles-js 沒有覆蓋整個頁面

[英]particles-js does not cover the whole page

我對particles-js 有一些問題,首先,它沒有覆蓋整個頁面。 其次,由於某種原因,我無法與粒子交互。

這是 HTML 的代碼:

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

And this is my css for particles-js: 
            #particles-js{
        position : absolute;
        width:100%;
        height:100%;
        z-index:-1;
        background-image: url(gfx/testback.png);
}


  [1]: https://i.stack.imgur.com/XO6w5.png

像我的網站一樣,用粒子 js 覆蓋所有頁面真的很容易: https://askianoor.ir你應該添加一個高度為 100 的 div

編輯版本:

<body>
   <div class="h-100">
       <!-- PARTICLES-->
       <div id="particles-js">
           <div class="position-absolute w-100">
              Place your text here !
           </div>
       </div>
   </div>
</body>

在 CSS 中:

#particles-js {
  position: absolute;
  width: 100%;
  height: 100%;
  background-color: #b61924;
  background-image: url(gfx/testback.png);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: 50% 50%;
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM