我买了一个模板,我正在修改它,使我的网站,我是一个设计师,我没有太多的代码,但我想学习,我决定冒险做这样的网络。我想把插件particles.js作为背景,我设法把它放在索引中,但我已经这样放置,我不知道如何扩大它。就像在photoshop里,把它从一个角落拿出来,拖着占据整个背景。
问题是:

下面是particle.js到index.html的div:
<div id="particles-js"
style="background-color: #000; position: absolute; background-size: cover; background-repeat: no-repeat; background-position: 100%;">
<canvas class="particles-js-canvas-el"
style="width: 100%; height: 100%;" width="1617" height="708">
</canvas>
</div>它位于脚本之上,在页脚下面。
发布于 2018-12-11 19:50:09
您所需要的只是一些CSS来定位<div>。将其添加到<style>标记中。当你被困在未来的时候,一个好的开始就是W3学校CSS简介。,祝你好运!
/* the #id of your div */
#particles-js {
/* stay in a constant spot on the page, regardless of scroll */
position: fixed;
/* fill the entire page */
width: 100%;
height: 100%;
/* remove the space along the edges */
margin: 0;
padding: 0;
/* position it to start at the top of the page */
top: 0;
/* put it behind other content */
z-index: -1;
}

https://stackoverflow.com/questions/53715659
复制相似问题