How to check if CSS property is supported in browser using JavaScript ? Last Updated : 01 Jun, 2023 Summarize Comments Improve Suggest changes Share 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 check if CSS property is supported in browser 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 a webpage is loaded inside an iframe or into the browser window using JavaScript? An iFrame is a rectangular frame or region in the webpage to load or display another separate webpage or document inside it. So basically, an iFrame is used to display a webpage within a webpage. You can see more about iFrames here : HTML iFrames There may be a variety of reasons for checking whethe 4 min read How to detect flash is installed or not using JavaScript ? The task is to detect whether the user has installed Adobe Flash player or not with the help of JavaScript. we're going to discuss 2 techniques. Approach: Create a ShockwaveFlash.ShockwaveFlash object.If the instance's value is true, Flash is installed.If any error occurred, Use navigator.mimetypes 2 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 Like