How to check if CSS property is supported in browser using JavaScript ? Last Updated : 01 Jun, 2023 Comments Improve Suggest changes Like Article Like Report Few CSS properties are not supported in some browsers, thus it is required to check whether a CSS property & its value are supported in the current browser. We can find it using JavaScript using CSS.supports() method. Syntax: supports(propertyName, value) supports(condition) There are two distinct parameters: propertyName: A string containing the name of the CSS property to check.value: A string containing the value of the CSS property to check. The second syntax takes one parameter condition which contains the condition to check. Return value: Returns true if the browser supports the rule, otherwise returns false. Example 1: The below example will illustrate how to check if CSS property is supported in the browser using JavaScript HTML <!DOCTYPE html> <html> <head> <title>GeeksforGeeks</title> </head> <body> <h1 style="color:green; "> Welcome to GeeksforGeeks </h1> <script> // Returns 'true' result1 = CSS.supports("display: flex"); // Returns 'false' result2 = CSS.supports("transform-style: preserve"); console.log(result1); console.log(result2); </script> </body> </html> Output: Example 2: In the below example, if the value was '1%' instead of 'green' the output would be 'Not supported'. HTML <!DOCTYPE html> <html> <head> <title>GeeksforGeeks</title> </head> <body> <h1 style="color:green; "> Welcome to GeeksforGeeks </h1> <script> if (CSS.supports('color', 'green')) console.log( 'border-radius is supported with given value'); else console.log('Not supported'); </script> </body> </html> Output: Example 3: In this example, the 'text-overline-color' CSS property has become obsolete and not supported in today's modern browser. HTML <!DOCTYPE html> <html> <head> <title>GeeksforGeeks</title> </head> <body> <h1 style="color:green; "> Welcome to GeeksforGeeks </h1> <script> if (CSS.supports('text-overline-color', 'green')) console.log( 'text-overline-color is supported with given value'); else console.log('Not supported'); </script> </body> </html> Output: Supported browsers: ChromeEdgeFirefox OperaSafari Comment More infoAdvertise with us Next Article How to detect page zoom level in all modern browsers using JavaScript ? P priddheshinternship Follow Improve Article Tags : JavaScript CSS-Properties JavaScript-Questions Similar Reads How to return true if browser tab page is focused in JavaScript ? There may be situations when we need to check if a browser tab is focused or not. The reasons for this include: Prevent sending network requests if the page is not being used by the user as this would reduce the amount of load on the server. Also, this would save upon the cost if we are using a paid 4 min read How to check whether the background image is loaded or not using JavaScript ? In this article, we will check whether the background image is loaded or not using JavaScript. In JavaScript, onload event is used to check whether a window is loaded or not. Similarly, we can use that event to check whether a particular element has loaded or not. There are two ways in which we can 2 min read How to detect the user browser ( Safari, Chrome, IE, Firefox and Opera ) using JavaScript ? The browser on which the current page is opening can be checked using JavaScript. The userAgent property of the navigator object is used to return the user-agent header string sent by the browser. This user-agent string contains information about the browser by including certain keywords that may be 4 min read How to detect page zoom level in all modern browsers using JavaScript ? In this article, we will discuss how the current amount of Zoom can be found on a webpage.These are the following methods: Table of ContentUsing outerWidth and innerWidth PropertiesUsing clientWidth and clientHeight PropertiesUsing the window.devicePixelRatio PropertyMethod 1: Using outerWidth and i 3 min read How to check the current runtime environment is a browser in JavaScript ? In this article, we will see how to detect the runtime environment in which our JavaScript code is running. Suppose you are building an application in Node.js and need to include that code in a webpage that would be run on a browser. This would cause some functions of a Node application not to work 2 min read How to detect HTML 5 is supported or not in the browser ? HTML 5 is the latest standard of HTML that includes many new changes and features. HTML 5 support can be detected by using three approaches:Method 1: Checking for Geolocation support: The Geolocation API was added in HTML5. It is used for identifying the user's location. The presence of this API cou 4 min read Like