css3 这两个语句对于变换来说是等价的吗?
我想知道这两组陈述是否等效。我以为他们是,但他们似乎在做不同的事情。
-webkit-transform: rotate(45deg);
-webkit-transform: translateX(200px);
-webkit-transform-origin:0% 100%;
并且......
-webkit-transform: rotate(45deg) translateX(200px);
-webkit-transform-origin:0% 100%;
似乎在第一组语句中,仅执行了translateX,而rotate 没有执行。我将第一组语句的顺序更改为...
-webkit-transform: translateX(200px);
-webkit-transform: rotate(45deg);
-webkit-transform-origin:0% 100%;
并且它似乎只执行旋转而不是translateX。它只做后一种吗?然而,通过编写...
-webkit-transform: rotate(45deg) translateX(200px);
-webkit-transform-origin:0% 100%;
它首先进行旋转,然后进行平移X。我认为这应该只是编写它的简写。不是吗?
这是代码的链接。这真的很简单。 http://jsfiddle.net/gCeUe/2/
感谢您的帮助!清晰彻底的帮助将不胜感激=)
i was wondering if these two set of statements are equivalent or not. i thought they were but they seem to be doing different things.
-webkit-transform: rotate(45deg);
-webkit-transform: translateX(200px);
-webkit-transform-origin:0% 100%;
and...
-webkit-transform: rotate(45deg) translateX(200px);
-webkit-transform-origin:0% 100%;
it seems that on the first set of statements, only the translateX gets performed and rotate does not. i changed the order around for the first set of statements to...
-webkit-transform: translateX(200px);
-webkit-transform: rotate(45deg);
-webkit-transform-origin:0% 100%;
and it seems to just perform the rotate and not the translateX. does it just do the latter one? however by writing...
-webkit-transform: rotate(45deg) translateX(200px);
-webkit-transform-origin:0% 100%;
it does both the rotate first and then the translateX. i thought this was supposed to just be a shorthand of writing it. is it not?
here is a link to the code. it's really simple.
http://jsfiddle.net/gCeUe/2/
thanks for the help! clear and thorough help would be much appreciated = )
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
CSS 的解析方式使得 last 语句是唯一被渲染的语句:
当您像这样编写代码时:
-webkit-transform
设置为rotate(45deg)
,然后用translateX(200px)
覆盖。这是正确的语法:
CSS is parsed in a way so that the last statement is the only one that is rendered:
When you write your code like this:
-webkit-transform
is set torotate(45deg)
and then overwritten withtranslateX(200px)
.This is the correct syntax: