【发布时间】:2015-04-23 17:12:00
【问题描述】:
全部:
当我尝试 CSS 变换时,关于缩放顺序和翻译的一些东西让我感到困惑:
<svg>
<rect x="10" y="10" width="20" height="30" style="stroke: #3333cc; fill:none;"/>
<rect x="0" y="0" width="20" height="30" style="stroke: #000000; fill:none;" transform="scale(2) translate(10, 10)"/>
</svg>
<svg>
<rect x="10" y="10" width="20" height="30" style="stroke: #3333cc; fill:none;"/>
<rect x="0" y="0" width="20" height="30" style="stroke: #000000; fill:none;" transform="translate(10, 10) scale(2)"/>
</svg>
这两个产生不同的效果。谁能给我一些关于如何处理和呈现 CSS 转换的解释?
谢谢
【问题讨论】:
-
这两个产生不同的效果。 我在 jsfiddle 中看到了两次相同的东西:一个黑色矩形与位于左上角的一个小紫色矩形重叠。您能否详细说明您所看到的与您期望看到的?
-
@BSMP 对不起,我的错。我编辑我的问题。第二个svg中的变换属性应该是“translate(10, 10) scale(2)”而不是“scale(2) translate(10, 10)”