1
svg {
width: 100%; height: 100px;
border: solid 1px blue;
font-family: monospace;
transform: rotate(180deg);
}
text {
transform:rotate(180deg) translate(-100px);
}
<svg>
<text y="-85">
<tspan x="0" text-anchor="start">000</tspan>
<tspan x="0" text-anchor="start" dy="15">1234</tspan>
</text>
</svg>
我想在SVG的右上方位置左对齐多行文本。
svg的宽度未知,因为它设置为父级的100%宽度,所以我不认为我可以使用X
或dx
坐标。
我能够实现我想要的东西通过旋转把全部SVG和180 °其中的文本元素和施加负变换转换,但这种感觉就像一个黑客对我
什么是正确的方法?
更好的解决方案,谢谢 – andrew