7

Possible Duplicate:
Why do browsers create vendor prefixes for CSS properties?

For example, if I have an image that I'd like to rotate, why does Google Chrome do nothing when I use transform: rotate(50deg); but work fine when I use -webkit-transform: rotate(50deg);?

Isn't the whole point of having the standard to make it so that a programmer/designer only writes the same code once, and not once for each of the browsers? Is this something that is going to be changed in the foreseeable future or will it always be this way? I'm only just starting to use CSS3 and this seems really bizarre to me.

4

2 回答 2

6

CSS3 还没有作为一个完整的标准被正式采用——它仍然是一个草案提案

供应商特定标签允许供应商现在使用实验性实现开始实施 CSS3 草案标准或提议的 CSS3 想法,同时确保他们当前使用这些专有标签的渲染可以在未来与他们根据实际 CSS3 标签的渲染区分开来。最终规格,即使那是不同的。

于 2011-12-11T01:27:32.530 回答
2

标准声明尚未实现,前缀是供厂商测试和实现专有功能。随着代码变得稳定,浏览器应该开始使用标准语句。

因此,您必须始终将非前缀语句保留在末尾,如下所示:

-o-transition: all 1s linear;
-ms-transition: all 1s linear;
-moz-transition: all 1s linear;
-webkit-transition: all 1s linear;
transition: all 1s linear;

由于级联样式表因级联而得名。标准语句将在可用时覆盖其余语句。

于 2011-12-11T01:27:06.757 回答