|
|

楼主 |
发表于 2023-4-24 08:47
|
显示全部楼层
代码
- <style>
- #wrap {
- margin: 20px auto;
- width: 200px;
- height: 200px;
- border-radius: 50%;
- border: 1px dotted gray;
- position: relative;
- }
- .circle {
- position: absolute;
- width: 30px;
- height:30px;
- text-align: center;
- line-height: 30px;
- border-radius:50%;
- border: 1px solid tan;
- }
- </style>
- <div id="wrap"></div>
- <script>
- let x0 = y0 = r = wrap.offsetWidth / 2, total = 10;
- for(let i = 0; i < total; i ++) {
- let x1 = x0 + r * Math.cos(360 / total * i * Math.PI / 180),
- y1 = y0 + r * Math.sin(360 / total * i * Math.PI/180);
- let span = document.createElement('span');
- span.className = 'circle';
- span.innerText = i + 1;
- span.style.cssText += `
- left: ${x1 - 15}px;
- top: ${y1 - 15}px;
- `;
- wrap.appendChild(span);
- }
- </script>
复制代码
|
评分
-
| 参与人数 1 | 威望 +50 |
金钱 +100 |
经验 +50 |
收起
理由
|
红影
| + 50 |
+ 100 |
+ 50 |
赞一个! |
查看全部评分
|