尝试在父 SVG 中定位电池指示器。SVG<svg viewBox="0 0 24 24">元素具有电池路径和显示百分比的文本元素。它通过几个 css 转换和文本属性进行定位。在 chrome 中打开时,文本位置正确/firefox 但在 safari 中是分支。
<text
text-anchor="middle"
dominant-baseline="middle"
style="transform:translate(50%,98%) scale(.2);
font:700 13px sans-serif;fill:#deba78"
>24.2%</text>
Run Code Online (Sandbox Code Playgroud)