Particles JS 没有覆盖整个页面
Particles JS is not covering full page
您好!
我的问题是 Particles JS,它没有覆盖我的页面。顶部有一个space。
HTML:
...
<body>
...
<div id="particles-js"></div>
<img alt="Server Name" draggable="false" id="Logo" src="assets/img/logo.png">
<div id="Navigation">
<a href="#"><img alt="Forums" draggable="false" src="assets/img/icon_exemple.png"></a>
<a href="#"><img alt="Store" draggable="false" src="assets/img/icon_exemple.png"></a>
<a href="#"><img alt="Vote" draggable="false" src="assets/img/icon_exemple.png"></a>
</div>
<button id="Server" onclick="copyToClipboard('server.ip:port')"><span>Join to us</span></button>
...
</body>
...
CSS:
...
body {
background-image: url(../img/background.png);
background-position: center;
background-repeat: no-repeat;
background-size: cover;
height: 100vh;
}
#particles-js {
height: 100%;
width: 100%;
position: fixed;
z-index: -100;
}
...
我试图自己解决问题,尝试了不同的选择,但没有成功。
您应该将位置值添加到#particle-js
#particles-js {
height: 100%;
width: 100%;
position: fixed;
z-index: -100;
top:0;
left:0;
}
您好!
我的问题是 Particles JS,它没有覆盖我的页面。顶部有一个space。
HTML:
...
<body>
...
<div id="particles-js"></div>
<img alt="Server Name" draggable="false" id="Logo" src="assets/img/logo.png">
<div id="Navigation">
<a href="#"><img alt="Forums" draggable="false" src="assets/img/icon_exemple.png"></a>
<a href="#"><img alt="Store" draggable="false" src="assets/img/icon_exemple.png"></a>
<a href="#"><img alt="Vote" draggable="false" src="assets/img/icon_exemple.png"></a>
</div>
<button id="Server" onclick="copyToClipboard('server.ip:port')"><span>Join to us</span></button>
...
</body>
...
CSS:
...
body {
background-image: url(../img/background.png);
background-position: center;
background-repeat: no-repeat;
background-size: cover;
height: 100vh;
}
#particles-js {
height: 100%;
width: 100%;
position: fixed;
z-index: -100;
}
...
我试图自己解决问题,尝试了不同的选择,但没有成功。
您应该将位置值添加到#particle-js
#particles-js {
height: 100%;
width: 100%;
position: fixed;
z-index: -100;
top:0;
left:0;
}