2017-05-05 71 views

回答

0

请添加以下样式:

.container { 
    /*other css*/ 
    position: relative; 
    z-index: 1; 
} 
.particles-js-canvas-el { 
    width: 100%; 
    height: 100%; 
    position: absolute; 
    left: 0; 
    top: 0; 
    z-index: 0; 
} 
0

使用下面的代码:

HTML:

<div id="particles-js" style=""> 
    <canvas class="particles-js-canvas-el" width="1903" height="952" style="width: 100%;height: 100%;position: absolute;top: 0;left: 0;"></canvas> 
    <div class="container">   
     <div class="row"> 
      <div class="col-lg-12"> 
       <img class="img-responsive" src="img/EvanRen.jpg" alt="Evan Ren" style="width:500px;height:600px;border:5px solid white;border-radius: 50%;"> 
       <div class="intro-text"> 
        <span class="name">University of Waterloo Computer Science</span> 
        <hr class="star-light"> 
        <span class="skills">Problem_solving expert - Hardworking - Passionate</span> 
       </div> 
      </div> 
     </div> 
    </div> 
</div> 

CSS:

#particles-js { 
    width: 100%; 
    height: 100%; 
    background-color: #13717c; 
    position: relative; 
    top: 0; 
} 

重要的是,父母(#particles-js)有position: relative,以便您可以为孩子使用绝对定位。

+0

感谢您的快速响应!我已经添加了上述内容,但是我猜测我从另一个人的回答中获取了“particles-js-canvas-el”?我更新了我的文件,但似乎我仍然在做错事(粒子和一切都消失了) – flakpanzer40