Why do browsers create vendor prefixes for CSS properties?

前端 未结 2 755
栀梦
栀梦 2020-11-22 10:50

Maybe it\'s an obvious answer, but

Why on earth would browsers decide to create their own vendor prefixes for border-radius and the li

2条回答
  •  抹茶落季
    2020-11-22 11:25

    It's because the features were implemented by vendors before the specification reached its final release stage.

    The vendor prefixes ensure that there are no clashes with changing functionality etc.

    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.

提交回复
热议问题