Patricio Treviño

Patricio Treviño

Husband . Father . Developer

Detect browser support for specific CSS features

facebook sharing button
twitter sharing button
linkedin sharing button
reddit sharing button
digg sharing button
tumblr sharing button
whatsapp sharing button
email sharing button
print sharing button

Syntax

@supports [not](<supports-condition>) {
[styles]
}
view raw syntax.text hosted with ❤ by GitHub

Option Description
supports-condition The feature to be evaluated

Example

<html>
<head>
<style>
.support-font-size-adjust {
width: 22px;
display:inline-block;
}
.support-font-size-adjust:after {
content: '\274C';
font-size: 12px;
}
.support-flexbox {
width: 22px;
display:inline-block;
padding-left: 3px
}
.support-flexbox:after {
content: '\274C';
}
@supports(font-size-adjust) {
.support-font-size-adjust:after {
content: '\2713';
}
}
@supports(display:flex) {
.support-flexbox:after {
content: '\2713';
}
}
</style>
</head>
<body>
<span class="support-font-size-adjust"></span>Supports 'font-size-adjust'
<span class="support-flexbox"></span>Supports 'flexbox'
</body>
</html>
view raw example.html hosted with ❤ by GitHub

Output

Supports 'font-size-adjust'
Supports 'flexbox'