HTML & CSS Interview Question #138
What are CSS vendor prefixes?
Advanced CSS, Accessibility, Performance, Debugging & Senior Scenarios Senior Advanced
Quick Interview Answer
Vendor prefixes are browser-specific prefixes such as -webkit- that were historically used for experimental or non-standard implementations of CSS features. Modern standardized CSS often works without manually written prefixes, but some compatibility cases still exist.
Detailed Explanation
Vendor prefixes are browser-specific prefixes such as -webkit- that were historically used for experimental or non-standard implementations of CSS features. Modern standardized CSS often works without manually written prefixes, but some compatibility cases still exist.
Production projects commonly rely on tooling such as Autoprefixer, configured from supported browser targets, instead of manually guessing which prefixes are necessary. Developers should verify current compatibility before adding legacy declarations.
Code Example
/* Source CSS */
.example {
user-select: none;
}
/* Build tooling may add a required prefixed form
for the project's configured browser targets. */