【发布时间】:2021-04-17 11:56:41
【问题描述】:
我有一些 SVG 组件,其中心有文本 - 该文本在 Chrome 上呈现得非常好,但在 Safari 上却没有。 两种浏览器的区别如下:
我不确定是什么问题。我该如何解决这个问题?
这是代码的链接: https://codepen.io/iamegamind/pen/bGwmpVg?editors=1100
我已使用以下代码完成此操作:
<svg style="width: 250px; height: 250px"
viewBox="0 0 150 120"
class="progress-card"
xmlns="http://www.w3.org/2000/svg">
<circle style=" stroke-dasharray: 339.29; stroke-dashoffset: 439.29; stroke-width: 8"
r="40"
cx="50%"
cy="50%"/>
<text class="title" x="63" y="50">
<tspan text-anchor="middle" alignment-baseline="central">
Your credit score
</tspan>
</text>
<text class="score" x="63" y="65" text-anchor="middle" alignment-baseline="central">
510
</text>
<text class="status" style="fill: rgb(2, 171, 118)" x="63" y="85" text-anchor="middle" alignment-baseline="central">
Excellent!
</text>
<text class="min" x="30" y="105" text-anchor="middle" alignment-baseline="central">
0
</text>
<text class="max" x="95" y="105" text-anchor="middle" alignment-baseline="central">
710
</text>
</svg>
【问题讨论】:
-
您可以将问题报告给webkit bugtracker
标签: google-chrome svg safari