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.
/* 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 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-cellfor centering): use flexbox or grid. - Property hacks such as
*zoom,_heightand\9: they targeted old IE and are meaningless today. - Image replacement with
text-indent: -9999px: use real<img>withalt, or inline SVG. - Spacer elements and
<br>stacks: use margins, padding andgap. - Outline removal:
outline: nonewith no replacement is an accessibility bug; style:focus-visibleinstead. - Fixed pixel font sizes everywhere: prefer
remso users' text-size settings are respected. !importantas a default weapon: use cascade layers and sensible specificity.
Usage notes
- "Deprecated" usually means "still works". Aliases like
word-wrapstay 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-clampand-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.