Skip to content
Tutorials Center
My learning

Topics

CSS Reference ยท Practical Pages

Vendor prefixes

What CSS vendor prefixes are, why they existed, which prefixed properties you still need today, and how Autoprefixer and browserslist handle the rest.

A vendor prefix is a short label at the start of a property, value or selector name, such as -webkit-, -moz- or -ms-. Browser makers used them to ship experimental features without claiming the final name. If the design later changed, only prefixed code broke, not the open web.

The scheme caused its own problems: authors had to write the same declaration several times, and sites got stuck on prefixed code. Today new features arrive behind flags instead, not prefixes. Most prefixes you see in old code can be deleted, but a few remain genuinely useful.

CSS
.old {
  -webkit-transition: opacity 0.3s;
  -moz-transition: opacity 0.3s;
  transition: opacity 0.3s;
}

Try it

Two prefixed features that still work in every current browser: gradient text and a clamped paragraph.

Prefixed features that remain useful

The prefixes

Prefix Engine / browsers Status
-webkit- WebKit and Blink (Safari, Chrome, Edge, Opera, Android WebView) Still present, mostly as legacy aliases and a few real features
-moz- Gecko (Firefox) A few Firefox-only features remain
-ms- Old Internet Explorer and legacy Edge Obsolete, safe to remove
-o- Old Presto-based Opera Obsolete, safe to remove

Prefixes you may still meet

  • -webkit-line-clamp with display: -webkit-box and -webkit-box-orient: vertical: the working way to truncate to N lines. See the line-clamp reference page.
  • -webkit-text-stroke and -webkit-text-fill-color: no unprefixed equivalent is in wide use.
  • -webkit-background-clip: text: the unprefixed form is now widely supported, but keeping both is common for older Safari.
  • -webkit-user-select: Safari has long needed the prefixed form; see user-select.
  • -webkit-backdrop-filter: older Safari versions needed it; check a compatibility table before dropping it.
  • ::-webkit-scrollbar, ::-webkit-search-cancel-button and similar pseudo-elements: non-standard, WebKit/Blink only. Prefer scrollbar-width and scrollbar-color where possible.
  • -webkit-font-smoothing and -moz-osx-font-smoothing: non-standard, macOS only, and best avoided.

Prefixes you can usually delete

transition, transform, animation, @keyframes, box-shadow, border-radius, flex and related properties, calc(), linear-gradient(), appearance and box-sizing are all unprefixed in every current browser.

Usage notes

  • Let a tool do it. Autoprefixer reads a browserslist target and adds only the prefixes those browsers need. Hand-written prefix lists go stale.
  • Order matters. Write the prefixed declarations first and the standard one last, so the standard property wins where both exist.
  • An unknown prefixed name is ignored, just like any invalid declaration, so extra prefixes cost bytes but do not break pages.
  • Never guess. If a feature is new, look it up on a compatibility table instead of adding every prefix by habit.
  • Feature queries with @supports can test prefixed values, for example @supports (-webkit-backdrop-filter: blur(1px)).

Browser support

Prefixed features work in the engine they are named for, and the -webkit- forms are accepted by all major current browsers for the properties listed above.