# Keep a document readable when a CSS feature is unsupported

Canonical: https://githtml.com/guides/unsupported-css-feature-fallback
Published: 2026-11-23
Publisher: WaveTech LLC / gitHtml

Provide a simple readable baseline before using a newer CSS feature, and place optional enhancements behind @supports when appropriate. A feature query checks support for syntax, not whether the complete design works well. Verify the fallback by removing the enhancement rather than assuming an unsupported declaration will always leave the page usable.

## Identify the specific failure

A layout can fail because the author supplied only the enhanced version. Ignoring an unfamiliar declaration is normal browser behavior, but surrounding fixed sizes or hidden content may still make the remaining layout unusable.

## Make a narrow correction

Start with ordinary document flow and visible content. Add the enhancement in a narrow rule that does not erase essential information. Avoid hiding the baseline solely because a syntax test succeeds; successful parsing does not guarantee the desired behavior in every context.

1. Build a complete readable baseline before introducing the optional feature.
2. Use feature queries for enhancement boundaries, not as a replacement for testing.
3. Disable the enhancement and confirm that all essential content remains available.

````css
.cards { display: block; }
@supports (display: grid) { .cards { display: grid; gap: 1rem; } }
````

## Test failure by removing the enhancement, not the content

Consider a set of three report cards arranged with a newer layout feature. The cards should first exist as a sensible vertical sequence, each with its heading and explanation. If the feature is unavailable, that sequence is the reading experience. An empty container with instructions to wait for the enhanced layout is not a fallback. Test by temporarily removing the enhancement rule while keeping all the content and baseline styles; this makes the expected unsupported path visible without needing to locate an old device immediately.

A feature query answers whether the browser accepts the tested feature, not whether every surrounding combination is sound. A rule can parse successfully while a fixed height clips its content or an unrelated selector never matches. Keep the query narrow and inspect the applied declarations. If an enhancement changes alignment, avoid coupling it to content visibility unless there is a fully tested reason. Readers should not lose a warning because a typography or layout check happened to return true.

Fallbacks also need maintenance after content grows. An initially short title may become several lines, and a translated label may be much longer than the original. Add one deliberately difficult card to the test fixture and compare the plain and enhanced paths. Both should preserve order, links, and complete text, although spacing may differ. When the advanced treatment has no meaningful benefit for reading, omitting it can be an appropriate final choice rather than building a complicated compatibility branch solely to reproduce a decorative screenshot.

## Verify the repaired artifact

Compare both branches with the same long content and enlarged text. The fallback may be simpler, but it should answer the same reading question.

## Sources and further reading

- [MDN: @supports](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/At-rules/@supports)

## Related guides

- [Fix report panels cut off by mobile viewport height](https://githtml.com/guides/viewport-height-cuts-off-mobile-report)
- [Why a visible HTML link will not respond to a tap](https://githtml.com/guides/visible-link-wont-tap-pointer-events)
- [Undo aggressive word breaking in mixed-language prose](https://githtml.com/guides/word-break-damages-cjk-prose)
- [Why raw.githubusercontent.com shows HTML as plain text](https://githtml.com/guides/raw-githubusercontent-html-shows-as-plain-text)

Editorial approach: https://githtml.com/guides/about
