尝试在<g>内部<svg>垂直翻转



我试图垂直翻转<g>,但不起作用。事实上,我试图翻转的三角形显示了…

<!DOCTYPE html>
<html>
<body>
<svg height="210" width="500">
<g style="transform: scaleY(-1);"> <!-- THIS FLIPPING DOESN'T WORK-->
<polygon points="200,10 250,190 160,210" style="fill:lime;stroke:purple;stroke-width:1" />
</g>
<g>
<polygon points="400,20 450,390 260,310" style="fill:lime;stroke:purple;stroke-width:1" />
</g>
</svg>
</body>
</html>

试试这个

<!DOCTYPE html>
<html>
<body>
<svg height="240" width="500">
<g transform="scale(1, -1) translate(0, -250)">
<polygon points="200,10 250,190 160,210" style="fill:lime;stroke:purple;stroke-width:1" />
</g>
<g>
<polygon points="400,20 450,390 260,310" style="fill:lime;stroke:purple;stroke-width:1" />
</g>
</svg>
</body>
</html>

最新更新