Power Your Software Testing with AI and Cloud

Supercharge QA with AI for Faster & Smarter Software Testing

Next-Gen App & Browser Testing Cloud

CSS if() function

The if CSS function allows different values to be set for a property depending on the result of a conditional test. The test can be based on a style query, a media query, or a feature query.

Last updated on : 2026-02-09

Browser Versions

IEIE

EdgeEdge

FirefoxFirefox

ChromeChrome

SafariSafari

OperaOpera

5.5 - 11
Test on IE 5.5 - 11 ...
12 - 136
Test on Edge 12 - 136 ...
137 - 144
Test on Edge 137 - 144 ...
2 - 150
Test on Firefox 2 - 150 ...
4 - 136
Test on Chrome 4 - 136 ...
137 - 147
Test on Chrome 137 - 147 ...
3.2 - 26.3
Test on Safari 3.2 - 26.3 ...
9.5 - 125
Test on Opera 9.5 - 125 ...
121 - 122
Test on Opera 121 - 122 ...

...Fully Supported

...Partially

...No Support

Browser Compatibility

CSS if() function on IE is not supported on any IE versions.

CSS if() function on Edge is fully supported on 137-144, and not supported on 12-136 Edge versions.

CSS if() function on Firefox is not supported on any Firefox versions.

CSS if() function on Chrome is fully supported on 137-147, and not supported on 4-136 Chrome versions.

CSS if() function on Safari is not supported on any Safari versions.

CSS if() function on Opera is fully supported on 121-122, and not supported on 9.5-125 Opera versions.

CSS if() function on Safari on iOS is not supported on any Safari on iOS versions.

CSS if() function on Android Browser is fully supported on 138-144, and not supported on 2.3-4 Android Browser versions.

CSS if() function on Opera Mobile is not supported on any Opera Mobile versions.

CSS if() function on Chrome for Android is fully supported on all Chrome for Android versions.

CSS if() function on Firefox for Android is not supported on any Firefox for Android versions.

CSS if() function on Samsung Internet is not supported on any Samsung Internet versions.

22
Lowtooltip

Overall Browser Compatibility Score

Note:CSS if() function shows a browser compatibility score of 22. This is a collective score out of 100 to represent browser support of a web technology. The higher this score is, the greater is the browser compatibility. The browser compatibility score is not a 100% reflection for every browser and the web technology support. However, it does give you an estimate on how much you should rely on a particular web technology in terms of browser compatibility.


Test on 3000+ browsers for CSS if() function & more

Test your website for CSS if() function and other web technologies. Get 100 FREE automation test minutes!

Test Now...

More Web Technologies

  • CSS
  • HTML 5
  • SVG
  • JS API
  • Security
  • JavaScript
  • Other Web Technologies

Did you find this page helpful?

Helpful

NotHelpful

TestMu AI forEnterprise

Get access to solutions built on Enterprise
grade security, privacy, & compliance

  • Advanced access controls
  • Advanced data retention rules
  • Advanced Local Testing
  • Premium Support options
  • Early access to beta features
  • Private Slack Channel
  • Unlimited Manual Accessibility DevTools Tests