如何解决HTML5是否将动画画布作为Div元素的背景?
我希望将此JS-https://codepen.io/jkiss/pen/OVEeqK-作为首页上div元素的背景。
HTML
<script src="{% static 'home/animated.js' %}"></script>
<div class = "content-section">
<div id = "canvas-wrap">
<canvas id="nokey"></canvas>
<div class = "bg-1 media" id = "overlay">
<div class = "container">
<img src = "../../../media/pfp.jpg" class = "profile-img img-thumbnail rounded-circle">
<div class = "media-body intro">
<h1 class = "">My Name</h1>
<h4>Aspiring Web Developer</h4>
</div>
</div>
</div>
</div>
CSS
body{
background-color: #222222;
font:inherit;
font-family: Titillium;
margin:0;
padding:0;
}
#canvas-wrap { position:absolute; width:100px; height:50px; z-index:0 }
#canvas-wrap canvas { position: absolute; top:0; left:0; z-index:0 }
#nokey{
background-color: darkblue;
}
.content-section{
margin-left: 50px;
margin-right: 50px;
margin-bottom: 50px;
background: aliceblue;
}
.bg-1 .container{
display: flex;
align-items: center;
justify-content: center;
}
.intro{
flex: none;
margin-top: 200px;
margin-bottom: 200px;
padding-left: 25px;
color: white;
}
我该怎么办?当前,画布占据了所有屏幕,并在其后面创建了div。
解决方法
使用#ifndef SQUARE_H
#define SQUARE_H
#include "flags.h" // REMOVE #include of .cu file!!!
void host_sq_array(int *a_d);
#endif
CSS属性将div移至其他元素更高的位置:
#include square.h
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。