MyInternships.in

CSS References

CSS Browser Support

Browsers ship CSS features at different times, so before relying on something new you should check its support and plan a graceful fallback. This guide covers how to look up support with caniuse, how to detect features at runtime with @supports, when vendor prefixes still matter, and gives rough support levels for several modern features.


How to check support

  • Look up any property or feature on caniuse.com to see per-browser support and usage share.
  • Check MDN — each property page has a Browser compatibility table at the bottom.
  • Detect support at runtime in CSS with the @supports at-rule (feature queries).
  • Detect support in JavaScript with CSS.supports("display", "grid").

Progressive enhancement with @supports

Write a baseline that works everywhere, then layer on modern CSS only where it is supported. This is progressive enhancement — nobody gets a broken page, and capable browsers get the best experience.

/* Baseline: floats or block layout everywhere */
.cards > * { display: inline-block; width: 32%; }

/* Enhancement: grid where supported */
@supports (display: grid) {
  .cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .cards > * { width: auto; }
}

/* Only when a feature is NOT supported */
@supports not (aspect-ratio: 1) {
  .thumb { height: 180px; }
}

Vendor prefixes

Historically, experimental features shipped behind vendor prefixes like -webkit-, -moz- and -ms-. Most modern features no longer need them, but a few still do. Put prefixed versions before the unprefixed one so the standard wins when supported.

PrefixVendor / engine
-webkit-Chrome, Safari, Edge, most mobile browsers
-moz-Firefox (Gecko)
-ms-Old Internet Explorer / legacy Edge
-o-Old Opera (Presto)
💡

Let a build tool like Autoprefixer add prefixes automatically from your target browser list — hand-writing them is error-prone and quickly goes stale.

Rough support for modern features

Support levels below are approximate as of the mid-2020s. Always confirm on caniuse for your exact target browsers.

FeatureSupportNotes
FlexboxUniversalSafe everywhere.
CSS GridUniversalSafe in all modern browsers.
Custom properties (var())UniversalSafe everywhere.
gap in FlexboxExcellentAll current browsers.
clamp() / min() / max()ExcellentWidely supported.
:has() selectorGoodAll modern engines; not in very old browsers.
Container queriesGoodSupported in current browsers; check older versions.
Cascade layers (@layer)GoodModern browsers.
SubgridFair/GoodNewer; verify on caniuse.
oklch() coloursGoodModern browsers; provide an rgb fallback.
accent-colorGoodModern browsers; degrades to default control.
text-wrap: balanceFairProgressive enhancement only.
⚠️

Never assume a feature is supported because it works in your browser. Test your real target audience's browsers, and always provide a sensible fallback.

Related CSS Topics

Keep learning with these closely related tutorials.

Ready to use your CSS skills?

Find web development internships and fresher jobs across India.

Browse Web Dev Internships