正在回答 回答被采纳积分+1
2回答
Tsuki_tsuki
2018-05-14 17:10:28
这个题我也是看了一下问答的各种答案,还有1楼同学的图然后才有了点思路做出来的……
如果是说是想问怎样得到一个平均分的五角星,大概是这个思路:
五角星由三个一样大小的三角形拼出来的;
这三个三角形中有一个三角形的边框数值和另外两个相反;
蓝色三角形和黄色三角形通过旋转等操作刚好有一个角重合(右下角);
粉色三角形旋转后保证有一条边和黄三角形水平的那条边在一条水平线上,顶点和黄蓝两个三角形的交点(大概左上那个位置)重合;
最后就是各种调试位置什么的……= =|||
其他四个五角星就用缩放实现,然后调位置就好……具体可以参考网上绘制五星红旗的尺寸标准什么的……
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | <!DOCTYPE HTML> < html > < head > < meta charset = "utf-8" > < title >2-7</ title > < style type = "text/css" > /* 此处写代码*/ body{ margin: 0; padding: 0; } .flag{ margin: 50px; width: 450px; height: 300px; background-color: red; position: relative; } .star{ top:25px; left: 50px; position: absolute; width:0; height:0; border-top:45px solid transparent; border-right:30px solid transparent; border-bottom:45px solid transparent; border-left:30px solid yellow; transform: rotate(-54deg); } .star::before{ top:-54px; left:-60px; content: ""; position: absolute; width:0; height:0; border-top:45px solid transparent; border-right:30px solid blue; border-bottom:45px solid transparent; border-left:30px solid transparent; transform: rotate(34deg); } .star::after{ top:-46px; left:-56px; content: ""; position: absolute; width:0; height:0; border-top:30px solid transparent; border-right:45px solid transparent; border-bottom:30px solid pink; border-left:45px solid transparent; transform: rotate(20deg); } .s1{ left:125px; top:-5px; -webkit-transform:scale(0.4) rotate(30deg); } .s2{ left:165px; top:20px; -webkit-transform:scale(0.4) rotate(-10deg); } .s3{ left:165px; top:75px; -webkit-transform:scale(0.4) rotate(15deg); } .s4{ left:125px; top:108px; -webkit-transform:scale(0.4) rotate(30deg); </ style > </ head > < body > <!-- 此处写代码 --> < div class = "flag" > < div class = "star" ></ div > < div class = "star s1" ></ div > < div class = "star s2" ></ div > < div class = "star s3" ></ div > < div class = "star s4" ></ div > </ div > </ body > </ html > |
bbbboom
2018-05-14 11:46:19
响应式开发与常用框架 2018
- 参与学习 人
- 提交作业 2198 份
- 解答问题 5012 个
如果你有web端基础,既想进阶,又想进军移动端开发,那就来吧,我们专题为你带来的课程有HTML5、CSS3、移动基础、响应式、bootstrap、less等,让你在前端道路上畅通无阻!
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧