五星红旗任务,看看有无问题
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>2-3</title>
<style type="text/css">
/* 此处写代码*/
.flag{
width: 300px;
height: 200px;
background-color: red;
margin: 50px auto;
}
.star{
position: relative;
width: 0;
height: 0;
border: 10px solid transparent;
border-top:6px solid yellow;
}
.star::after{
display: block;
position: absolute;
top: -13px;
left: -15px;
width: 0;
height: 0;
border: 10px solid transparent;
border-top:6px solid yellow;
transform: rotate(140deg);
content:"";
}
.star::before{
display: block;
position: absolute;
top: -8px;
left: -15px;
width: 0;
height: 0;
border: 10px solid transparent;
border-top:7px solid yellow;
transform: rotate(70deg);
content:"";
}
.bigstar{
transform: scale(2.5) translate(15px,20px);
}
.star1{
transform: translate(80px,0) rotate(-45deg);
}
.star2{
transform: translate(100px,5px) rotate(-30deg);
}
.star3{
transform: translate(100px,15px);
}
.star4{
transform: translate(80px,20px) rotate(30deg);
}
</style>
</head>
<body>
<!-- 此处写代码 -->
<div class="flag">
<div class="star bigstar"></div>
<div class="star star1"></div>
<div class="star star2"></div>
<div class="star star3"></div>
<div class="star star4"></div>
</div>
</body>
</html>
27
收起
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星