使用相对定位或绝对定位写,
符合一个初学者的能力并且不能超出这个范围,
蝴蝶html?来张图
<!DOCTYPE html>
<html>
<head>
<title>蝴蝶</title>
<style>
body {
margin: 0;
padding: 0;
background-color: #cccccc;
}
.butterfly {
position: relative;
top: 50px;
width: 200px;
height: 150px;
background-color: #ff69b4;
border-radius: 50% 50% 0 0;
transform: rotate(-45deg);
box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.5);
}
.wing {
position: absolute;
width: 100px;
height: 100px;
background-color: #ffffff;
border-radius: 50%;
top: 25px;
box-shadow: inset 5px 5px 10px rgba(0, 0, 0, 0.5);
}
.left-wing {
left: -50px;
transform: rotate(45deg);
}
.right-wing {
right: -50px;
transform: rotate(-45deg);
}
.body {
position: absolute;
top: 50%;
left: 50%;
width: 50px;
height: 50px;
background-color: #000000;
border-radius: 50%;
transform: translate(-50%, -50%);
}
.antenna {
position: absolute;
width: 8px;
height: 30px;
background-color: #000000;
border-radius: 50%;
transform: rotate(45deg);
}
.left-antenna {
top: -30px;
left: 20px;
}
.right-antenna {
top: -30px;
right: 20px;
}
</style>
</head>
<body>
<div class="butterfly">
<div class="wing left-wing"></div>
<div class="wing right-wing"></div>
<div class="body">
<div class="left-antenna antenna"></div>
<div class="right-antenna antenna"></div>
</div>
</div>
</body>
</html>