css布局实现一个蝴蝶展翅飞行动画效果代码
代码语言:html
所属分类:动画
代码描述:css布局实现一个蝴蝶展翅飞行动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
html,
body {
position: relative;
z-index: 1;
height: 100vh;
}
.butterfly {
position: absolute;
z-index: 1;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
animation: flutter 0.3s infinite;
width: 345px;
height: 215px;
}
.butterfly .body {
position: absolute;
z-index: 3;
top: 65px;
left: 50%;
transform: translateX(-50%);
margin-top: 25px;
width: 28px;
height: 80px;
border-radius: 30% 30% 50% 50%;
background: #231f1d;
box-shadow: 2px 2px 8px #000;
}
.butterfly .body:after {
content: "";
position: absolute;
top: 60px;
left: 3px;
width: 0;
height: 0;
border-left: 12px solid transparent;
border-right: 12px solid transparent;
border-top: 38px solid #231f1d;
}
.butterfly .body .head {
position: absolute;
z-index: 4;
top: -25px;
left: 50%;
width: 30px;
height: 30px;
transform: translateX(-50%);
background: #eeaf9c;
border-radius: 30px 30px 50px 50px;
background: repeating-linear-gradient(90deg, #231f1d, #231f1d 2px, #372f23 2px, #372f23 4px);
box-shadow: 2px 2px 8px #000;
}
.butterfly .body .head:before, .butterfly .body .head:after {
content: "";
position: absolute;
top: -45px;
right: 15px;
.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0