css - 为什么浏览器要为 CSS 属性创建供应商前缀?

标签 css vendor-prefix

也许这是一个显而易见的答案,但是

为什么 到底 浏览器会决定为 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/

相关文章:

javascript - 如何在 Javascript 中将文本与图像相关联?

jquery one() 在 chrome 中不能正常工作

css - Less CSS - 在开发环境中使用 less.js 添加供应商前缀

html - mozilla 和 chrome 的结构布局差异

css - 如何配置 nib 使用的供应商前缀?

css - 删除 Chrome 自动完成的输入光标颜色?

html - 如何创建下拉列表来保存子菜单项

css - IOS Safari 过渡变换不起作用

css - 如何确定何时可以安全地删除 CSS3 属性的供应商前缀?

html - 导航栏中的 <div> 未正确对齐