Skip to content
Tutorials Center
My learning

Topics

CSS Reference ยท Practical Pages

Deprecated and legacy CSS

A guide to deprecated, obsolete and legacy CSS: old aliases, removed features, outdated hacks and the modern replacement for each one.

CSS rarely removes anything, because that would break old sites. So the language collects legacy features: old names kept as aliases, features replaced by better ones, vendor experiments and hacks from the Internet Explorer era. They usually still work, but you should not write them in new code. This page lists the common ones and what to use instead.

CSS
/* Legacy */                   /* Modern */
word-wrap: break-word;         overflow-wrap: break-word;
grid-gap: 1rem;                gap: 1rem;
page-break-before: always;     break-before: page;

Try it

Old aliases and their modern names produce the same result. Compare the left and right columns.

Legacy alias versus modern name

Legacy to modern

Avoid Use instead Notes
word-wrap overflow-wrap word-wrap is a permanent alias
grid-gap, grid-row-gap, grid-column-gap gap, row-gap, column-gap Aliases; the new names also work in flexbox
page-break-before/after/inside break-before, break-after, break-inside Aliases with older value names
clip: rect() clip-path clip only works on absolutely positioned elements
word-break: break-word overflow-wrap: anywhere The value is deprecated
display: -webkit-box for layout display: flex Only keep it for line clamping
-webkit-box-* and -moz-box-* properties Flexbox properties Old 2009 flexbox syntax
filter: alpha(opacity=50), -ms-filter opacity Internet Explorer only
zoom: 1 as a "hasLayout" fix Nothing IE7-era hack; note that real zoom is a separate, non-standard scaling feature
-ms-high-contrast media feature forced-colors See forced-colors
-webkit-overflow-scrolling: touch Normal overflow: auto Ignored by modern iOS
text-decoration: blink Nothing Never widely supported; also an accessibility hazard
text-justify: distribute text-justify: inter-character Deprecated value
behavior, expression() JavaScript or CSS Internet Explorer only
@viewport <meta name="viewport"> Never shipped broadly

Legacy techniques

  • Float layouts with clearfix hacks: replace with flexbox or grid. Floats remain right for wrapping text around an image.
  • Table layouts (display: table, table-cell for centering): use flexbox or grid.
  • Property hacks such as *zoom, _height and \9: they targeted old IE and are meaningless today.
  • Image replacement with text-indent: -9999px: use real <img> with alt, or inline SVG.
  • Spacer elements and <br> stacks: use margins, padding and gap.
  • Outline removal: outline: none with no replacement is an accessibility bug; style :focus-visible instead.
  • Fixed pixel font sizes everywhere: prefer rem so users' text-size settings are respected.
  • !important as a default weapon: use cascade layers and sensible specificity.

Usage notes

  • "Deprecated" usually means "still works". Aliases like word-wrap stay in browsers indefinitely, so there is no rush, but new code should use the standard name.
  • Check before deleting. Some non-standard features, such as -webkit-line-clamp and -webkit-text-stroke, look legacy but are still the practical choice. See vendor prefixes.
  • Linters help. Stylelint can flag deprecated properties automatically.
  • Old browsers, old rules. If you must support a very old browser, check its compatibility data rather than keeping every hack.

Browser support

Legacy aliases such as word-wrap, grid-gap and page-break-* still work in current browsers, while Internet Explorer hacks and removed features are ignored.