Each browser uses a specific prefix for CSS styles that are still in the "beta" phase (usually these prefixes disappear with newer browser versions). For example, -webkit
is used by Chrome, Opera, and Safari, while -moz
is used by Mozilla Firefox. Each vendor prefix is unique to the respective browser and may not work on others. You can find a list of commonly used prefixes here.
When writing CSS, it's best to avoid using vendor prefixes manually. Instead, consider automatically adding prefixes to your files after completing your project using an online service like Pleeease.io. Another option is to use a preprocessor like Prepos to add prefixes to your CSS automatically upon saving.
Here's an example using Pleeease.io:
INPUT
.a {
display: flex;
background: linear-gradient(red, green);
}
OUTPUT
.a {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
background: -webkit-linear-gradient(red, green);
background: linear-gradient(red, green);
}