A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.mozilla.org/en-US/docs/Web/API/CSS/supports_static below:

CSS: supports() static method - Web APIs

CSS: supports() static method

Baseline Widely available

The CSS.supports() static method returns a boolean value indicating if the browser supports a given CSS feature, or not.

Syntax
CSS.supports(propertyName, value)
CSS.supports(supportCondition)
Parameters

There are two distinct sets of parameters. The first one allows to test the support of a pair property-value:

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 matching the condition of @supports:

supportCondition

A string containing the condition to check.

Return value

true if the browser supports the rule, otherwise false.

Examples

In the following examples, result is a boolean value indicating if the browser supports the given CSS feature.

result = CSS.supports("text-decoration-style", "blink");
result = CSS.supports("display: flex");
result = CSS.supports("(--foo: red)");
result = CSS.supports("selector(:has(a))");
result = CSS.supports(
  "(transform-style: preserve) or (-moz-transform-style: preserve) or (-webkit-transform-style: preserve)",
);

For more examples and syntax features, see the @supports at-rule.

Specifications Browser compatibility See also

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.3