Legacy and vendor-prefixed CSS
Definition and purpose
Legacy CSS remains in real projects because browser targets and old layout techniques differ. Vendor prefixes historically exposed engine-specific or early implementations.
Legacy columns
<!doctype html><html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>CSS practice</title> <style> body { margin: 0; font: 16px sans-serif; color: #172033; background: white; } #a { display: flow-root; } #b, #c { float: left; width: 100px; } </style> </head> <body> <div id="a"> <div id="b">One</div> <div id="c">Two</div> </div> <button id="d" type="button">Open</button> </body></html>Floats form two fixed-width columns; the wrapper contains them.
Syntax and mental model
Floats can wrap text but older sites also used them for columns. Migrate a column layout to flex or grid when the target supports it; clear old float rules to avoid incidental layout changes. When a prefixed property has an equivalent standard form and is genuinely needed for the target, put the prefixed declaration first and the standard declaration last. Prefixes are not always equivalent: verify feature-specific compatibility and preserve required fallback behavior. Do not remove native control appearance without accessible replacement.
Standard spelling last
<!doctype html><html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>CSS practice</title> <style> body { margin: 0; font: 16px sans-serif; color: #172033; background: white; } #d { -webkit-user-select: none; user-select: none; } </style> </head> <body> <div id="a"> <div id="b">One</div> <div id="c">Two</div> </div> <button id="d" type="button">Open</button> </body></html>The local engine resolves the standard property. This is not evidence that the prefix is needed.
Common mistakes
Do not delete all prefixed syntax automatically or replace floats used for text wrapping with flex. Their semantics differ.
Practice and next steps
After trying the examples, complete the linked coding exercise and review questions. Predict the result before running your code. Prerequisite: Feature detection and progressive enhancement. Next lesson: Emerging layout and conditional features.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Legacy and vendor-prefixed CSS — knowledge check
Five questions on legacy and vendor-prefixed css.
Why do vendor prefixes exist?
When should a prefix be retained?
What order is typical for equivalent prefixed and standard declarations?
What is a legitimate current float use?
What must migration verify?