小编Nim*_*eem的帖子

在SVG或CSS中创建圆形进度栏

我尝试设计一个内部包含一些信息的圆形进度栏。这样的事情。 在此处输入图片说明

我有svg,但我也不能在圈子内写。起点和终点的距离很短。我正在寻找类似图像的东西。

svg {
  height: 200px;
  margin: auto;
  display: block;
}

path {
  stroke-linecap: round;
  stroke-width: 2;
}

path.grey {
  stroke: lightgrey;
}

path.purple {
  stroke: purple;
  stroke-dasharray: calc(40 3.142 1.85);
  stroke-dashoffset: 80;
  / adjust last number for variance /
}
Run Code Online (Sandbox Code Playgroud)
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewbox="0 0 100 100">
 <path class="grey" d="M40,90
    A40,40 0 1,1 70,90"
    style="fill:none;"/>
 <path class="purple" d="M40,90
    A40,40 0 1,1 70,90"
    style="fill:none;"/>
</svg>
Run Code Online (Sandbox Code Playgroud)

html css svg

1
推荐指数
1
解决办法
421
查看次数

标签 统计

css ×1

html ×1

svg ×1