Key Points
-webkit
prefixes) presents potential problems with Web standards and cross-browser compatibility. Developers often use these prefixes to access new features, but this can lead to non-standardized, browser-specific code. -webkit
prefix in non-WebKit browsers. However, this can lead to incompatibility in the implementation of the same attribute and further encourage developers to use WebKit-specific attributes, which may make them the de facto standard. The relationship between the developer and the CSS vendor prefix is intertwined with love and hate. They allow us to use cutting-edge technology, but at the cost of a lengthy statement:
background-image: -webkit-linear-gradient(#fff, #000); background-image: -moz-linear-gradient(#fff, #000); background-image: -ms-linear-gradient(#fff, #000); background-image: -o-linear-gradient(#fff, #000); background-image: linear-gradient(#fff, #000);
Theoretically works well, but consider the actual situation: 1. Experimental properties are usually implemented first in the WebKit engine, and there is no guarantee that they will be copied in other browsers. 2. It is difficult to determine whether the vendor prefix attribute is part of the CSS specification. Some vendors do not submit attributes for standardization. 3. Incorrect vendor prefix versions continue to be supported even if standard properties change. The old code still works; you won't revisit it to correct the implementation.
You often find that websites use only the -webkit
prefix—even if other browsers support the property or it has wide availability without the prefix (e.g. border-radius
). Therefore, Chrome and Safari look better than competing browsers—other manufacturers are not satisfied with this. This question was raised and discussed at the W3C meeting on February 7, 2012: > Web standards advocates are teaching people to use WebKit. You will see presentations from all Web standards advocates who advocate people to use WebKit prefixes. Our job is to solve interoperability problems. Currently, we are trying to determine which and how many WebKit prefix properties are actually supported in Mozilla. If we do not support the WebKit prefix, we will be excluded from a part of the mobile web.
Let's think about this carefully. Non-WebKit browsers will support the -webkit
prefix. This is the solution W3C is considering. This idea is likely to be a crushing defeat. Two or more implementations of the same WebKit property will be incompatible, so developers will not be able to use it anywhere. No one will win – including Apple and Google. But I'm more worried about the irreparable damage it will cause if the solution is successful. Once developers find that WebKit prefix is valid in Firefox, IE, and Opera, they expect them to work on all attributes. WebKit-only adoption will grow exponentially and vendors will be forced to implement these prefixes throughout the process. At that time, regardless of any W3C specification, WebKit attributes will become the de facto standard. Game End: The Open Web is closed. Its impact also goes beyond CSS: many new JavaScript APIs have vendor prefixes.
We can blame the failure on:
I object to non-WebKit browsers to support WebKit prefixes. At best, it makes the prefix unusable. At worst, it disrupts the entire standardization process. You may agree or disagree, but please express your opinion to colleagues, blogs and social networks. W3C and browser manufacturers will listen to your feedback; you only need to provide some feedback. Then test your website in multiple browsers. A little elegant downgrade is OK, but ignoring one or more modern browsers with equal support is not OK. Fix the code or your website is exacerbating the problem. FAQs (FAQs) about CSS prefixes and WebKit CSS prefix, also known as vendor prefixes, is a way for browser manufacturers to add them before the new CSS features become the W3C (World Wide Web Alliance) standard. These prefixes ensure that the new feature is only valid in its browser. For example, WebKit prefix crisis refers to a situation where non-WebKit browsers start supporting the To use CSS prefixes, just add them before the CSS properties in the stylesheet. For example, to use the (The answers to the following questions are similar, and have been omitted to maintain the overall structure of the article and the integrity of the information) The above is the detailed content of The Impending CSS Vendor Prefix Catastrophe. For more information, please follow other related articles on the PHP Chinese website!CSS prefixes (such as
-moz-
, -o-
, -ms-
and -webkit-
)? -moz-
is for Mozilla Firefox, -o-
is for Opera, -ms-
is for Microsoft Internet Explorer and Edge, -webkit-
is for browsers using the WebKit engine, such as Safari and older versions of Chrome. What is a WebKit prefix crisis?
-webkit-
prefix to ensure compatibility with sites that use only these prefixes. This leads to fragmentation of web standards and makes it harder for new browsers to enter the market. How to use CSS prefix in my code?
border-radius
attribute with a vendor prefix, you can write: background-image: -webkit-linear-gradient(#fff, #000);
background-image: -moz-linear-gradient(#fff, #000);
background-image: -ms-linear-gradient(#fff, #000);
background-image: -o-linear-gradient(#fff, #000);
background-image: linear-gradient(#fff, #000);