Robustness is one of the four principles of the Web Content Accessibility Guidelines (WCAG), which alone explains why fallbacks deserve attention in front-end work. A modern interface should not shut out users whose browsers or hardware are only partially compatible or not compatible at all. The remedy is a set of safety nets spread across HTML, CSS and JavaScript, so that failures either pass unnoticed or are explained clearly.
Fallbacks versus progressive enhancement
The two approaches differ in direction. Progressive enhancement works forward: features are made available as long as they are supported, and where a shiny new CSS feature is missing, users simply get the older supported version without noticing. Fallbacks work backward: they define what happens when something is unavailable or inaccessible. A JavaScript-based critical application that fails to load, for instance, should offer basic functionality or at least a message explaining the problem.
Neither approach excludes the other. A reasonable working rule is to treat progressive enhancement as the guiding principle and to add fallbacks wherever possible.
Knowing what is supported
Before shipping a feature to production, establish how widely it is supported. The Interop project, running since 2023, has major browser vendors releasing web platform features more or less simultaneously and gives a general overview. The Baseline project shows for individual features how much support they have and how long they have existed — but it does not track browser support for accessibility features built into the platform. Can I Use remains a quick reference for support tables.
HTML: error pages and <noscript>
Client-side rendering brings benefits for complex applications, but JavaScript can fail to load for many reasons. For a total failure, redirect users to an error page that says what went wrong and what both they and you can do to prevent it. Astro, for example, lets you add custom 404 and 500 error pages; other error codes are worth discussing with the back-end team as additional safeguards.
Individual sections or components can be hardened with <noscript>, which has excellent browser support according to Can I Use. A simplified fictional dashboard component shows the pattern:
<!-- Shown if no JavaScript was detected -->
<noscript>
<section aria-labelledby="user-statistics-heading">
<h2 id="user-statistics-heading">User statistics:</h2>
<p>Unfortunately, the user statistics could not be loaded because JavaScript is not available. Please click the “Refresh” button to try again. If the problem persists, click “Report problem” to contact our support team directly.</p>
<button type="button">Refresh</button>
<a href="mailto:[email protected]">Report problem</a>
</section>
</noscript>
<!-- Shown if JavaScript was detected -->
<section aria-labelledby="user-statistics-heading">
<h2 id="user-statistics-heading">User statistics:</h2>
<!-- Actual code -->
</section>
Without JavaScript, the components still appear, but the text states plainly that they cannot load at the moment and why. Users can reload that specific component or contact the team by email if the problem persists. Pre-filling the <a> tag's subject line with an internal error code and a matching body text means support receives everything needed on a single click, without follow-up questions. The pattern adapts to almost any use case and holds up when everything else breaks.
CSS: @supports with the and operator
Say the dashboard uses the anchor() function, which is fairly new with solid but not great support. Where a feature involves multiple properties, all of them must be checked, and the @supports rule handles exactly that. Use its and operator so the new CSS applies only when every property is available; otherwise the more robust, better-supported CSS takes over.
/* Fallback for unsupported browsers */
section[aria-labelledby="user-statistics-heading"] {
position: relative;
}
/* Available in supported browsers browsers */
@supports
(top: anchor(bottom)) and (position-anchor: auto) {
section[aria-labelledby="user-statistics-heading"] {
position: absolute;
top: anchor(#target bottom);
position-anchor: #target;
}
}
The rule doubles as documentation: once a feature has matured, a search for @supports in the codebase shows whether the rule and its fallback are still needed.
JavaScript: if…else and the ternary operator
A simple if…else statement can check for a feature before using it. For the relatively new Navigation API, the check looks like this:
if (window.navigation) {
// Navigation API is supported in this browser
} else {
// Navigation API is not supported in this browser, do something else or nothing
}
In a component-based setup where HTML, CSS and JavaScript share one file, the conditional ternary operator can render the component (or parts of it) only when appropriate, or render nothing. Since the dashboard relies on back-end data, it only makes sense to show it once the data has arrived:
// Option 1: Show component because JavaScript is not available:
{ userdata ?
<section aria-labelledby="user-statistics-heading">
<h2 id="user-statistics-heading">User statistics:</h2>
<!-- Actual code -->
</section> :
<noscript>
<section aria-labelledby="user-statistics-heading">
<h2 id="user-statistics-heading">User statistics:</h2>
<p>Unfortunately, the user statistics could not be loaded because JavaScript is not available. Please click the “Refresh” button to try again. If the problem persists, click “Report problem” to contact our support team directly.</p>
<button type="button">Refresh</button>
<a href="mailto:[email protected]">Report problem</a>
</section>
</noscript>
}
// Option 2: Don't show anything at all if no user data is available:
{ userdata ?
<section aria-labelledby="user-statistics-heading">
<h2 id="user-statistics-heading">User statistics:</h2>
<!-- Actual code -->
</section> :
null }
Depending on the use case, show a fallback or nothing; the conditions can be tightened or loosened to match the desired level of robustness.
Low effort, high value
Across companies, fallbacks and robustness tend to get less attention than they merit. Implementing these safety nets takes little effort, provided you think ahead about what should happen if something goes wrong. HTML, CSS and JavaScript each supply the elements and functions needed to ship robust code — and to spare users the frustration that might otherwise drive them away.



