也许这是一个显而易见的答案,但是
为什么 到底 浏览器会决定为 border-radius
等创建自己的供应商前缀?
我的意思是:为什么我必须输入:
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;
是否因为每个平台都认为“我们很酷,我们会想出一个更好的圆 Angular 方法?”一行输入三行似乎完全是多余的,而且莫名其妙。
最佳答案
这是因为这些功能是在规范到达最终发布阶段之前由供应商实现的。
供应商前缀确保不会与更改的功能等发生冲突。
Originally, the point of vendor prefixes was to allow browser makers to start supporting experimental CSS declarations.
Let’s say a W3C working group is discussing a grid declaration (which, incidentally, wouldn’t be such a bad idea). Let’s furthermore say that some people create a draft specification, but others disagree with some of the details. As we know, this process may take ages.
Let’s furthermore say that Microsoft as an experiment decides to implement the proposed grid. At this point in time, Microsoft cannot be certain that the specification will not change. Therefore, instead of adding grid to its CSS, it adds -ms-grid.
The vendor prefix kind of says “this is the Microsoft interpretation of an ongoing proposal.” Thus, if the final definition of grid is different, Microsoft can add a new CSS property grid without breaking pages that depend on -ms-grid
Source .
关于css - 为什么浏览器要为 CSS 属性创建供应商前缀?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48369052/