HTML/CSSIntermediate#css#cross-browser#tooling

How do you handle browser-specific CSS prefixes and why is Autoprefixer useful?

Some newer CSS features require vendor prefixes (-webkit-, -moz-) for partial browser support. Autoprefixer is a PostCSS plugin that automatically adds necessary prefixes based on a target browser list (browserslist), so developers write standard CSS without manually tracking prefix requirements.

Example
/* You write: */
.box { display: flex; user-select: none; }
/* Autoprefixer outputs: */
.box { display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-user-select: none; user-select: none; }

Related Questions

1
HTML/CSSBeginner#html#semantics

What is semantic HTML and why does it matter?

Open
2
HTML/CSSBeginner#html#elements

What is the difference between <div> and <span>?

Open
3
HTML/CSSBeginner#html#doctype

What does the DOCTYPE declaration do?

Open