小星星製做css3

```css

原理:一個正方形 兩個圓 定位 旋轉 圓角邊屬性 spa

body部分orm

<body>
<div class="heart-body">
<!--:before-->
<div class="heart-shape"></div>
<!--:after-->
</div>
</body>
css部分


.heart-body{
width: 200px;
height: 200px;
left: 50%;
top: 50%;
margin: 10px auto;
background: red;
position: absolute;
transform: rotate(45deg);
animation: love 1s ease infinite;
}
.heart-shape{
width: 200px;
height: 200px;
background: indianred;
box-shadow: 0 0 50px rgb(255,0,0);
}
.heart-body:before{
content:'';
width: 200px;
height: 200px;
background: indianred;
border-radius: 50%;
box-shadow: 0 0 50px rgb(255,0,0);
position: absolute;
top: 0;
left: -100px;
}
.heart-body:after{
content:'';
width: 200px;
height: 200px;
background: indianred;
border-radius: 50%;
box-shadow: 0 0 50px rgb(255,0,0);
position: absolute;
top: -100px;
left: 0px;
}
@keyframes love {
0%,100%{transform: scale(0.9,0.9)rotate(45deg)}
50%{transform: scale(1.2,1.2)rotate(45deg)}
}

```animation

相關文章
相關標籤/搜索