if()
The if() CSS function is an inline conditional value that returns a value based on a set of conditions.
Status
Limited availability
MDN documentation
Specifications
Browser support
- Chrome 137 Released on 2025-05-27
- Chrome Android 137 Released on 2025-05-27
- Edge 137 Released on 2025-05-29
- Firefox ❌ See bugzil.la/1981485 Vendor position : unknown
- Firefox for Android ❌ Vendor position : unknown
- Safari ❌ See webkit.org/b/296995 Vendor position : unknown
- Safari on iOS ❌ See webkit.org/b/296995 Vendor position : unknown
Surveys
Usage (according to Chrome Platform Status)
~0.128% of page loads. More data at chromestatus.com.Web Platform Tests (WPT)
View the latest WPT test results for this featureDeveloper votes
Do you need this feature?
Let us know by leaving a 👍 reaction on the feedback issue. Don't forget to also leave a comment explaining your specific use case.
View as JSON | Edit this feature | Report an issue | Web-features entry: source, dist