老师小星星的旋转角度,为什么没作用,rotate(angle)调了就跑偏了?
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>2-3</title>
<style type="text/css">
/* 此处写代码*/
div.container {
width: 600px;
height: 400px;
background: red;
margin: 100px auto;
position: relative;
}
div.start {
position: relative;
width: 0;
height: 0;
margin-top: 80px;
border-left: 100px solid transparent;
border-bottom: 70px solid yellow;
border-right: 100px solid transparent;
transform: rotate(35deg);
}
div.start::before {
position: absolute;
/*content 必须有,不然不显示*/
content: "";
width: 0;
height: 0;
top: 0px;
left: -94px;
border-left: 100px solid transparent;
border-bottom: 70px solid yellow;
border-right: 100px solid transparent;
transform: rotate(75deg);
}
div.start::after {
position: absolute;
/*content 必须有,不然不显示*/
content: "";
width: 0;
height: 0;
top: 0px;
left: -100px;
border-left: 100px solid transparent;
border-bottom: 70px solid yellow;
border-right: 100px solid transparent;
transform: rotate(-70deg);
}
div.start:nth-child(1) {
transform: scale(0.4) rotate(35deg) translate(50px,130px);
}
div.start:nth-child(2) {
transform: scale(0.15) rotate(3deg) translate(350px,-1069px);
}
div.start:nth-child(3) {
transform: scale(0.15) rotate(15deg) translate(150px,-1900px);
}
div.start:nth-child(4) {
transform: scale(0.15) rotate(13deg) translate(120px,-2550px);
}
div.start:nth-child(5) {
transform: scale(0.15) rotate(15deg) translate(-450px,-3200px);
}
</style>
</head>
<body>
<!-- 此处写代码 -->
<div class="container">
<div class="start"></div>
<div class="start"></div>
<div class="start"></div>
<div class="start"></div>
<div class="start"></div>
</div>
</body>
</html>8
收起
正在回答 回答被采纳积分+1
1回答
HTML5与CSS3实现动态网页 2018
- 参与学习 1887 人
- 提交作业 4643 份
- 解答问题 5760 个
有HTML和CSS基础,却不知道如何进阶?本路径带你通过系统学习,完成从“会做网页”到“做出好的动态网页”的蜕变,迈出成为前端工程师的第一步。
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星