<div>
<p class="yepnope">SUPPORTED!</p>
<code>
@supports(display: grid)
</code>
</div>
<div>
<p class="yepnope">SUPPORTED!</p>
<code>
@supports(display: -ms-grid)
</code>
</div>
<div>
<p class="yepnope">SUPPORTED!</p>
<code>
@supports (display: -ms-grid) and (display: grid)
</code>
</div>
<div>
<p class="yepnope">SUPPORTED!</p>
<code>
@supports (display: -ms-grid) and (not(display: grid))
</code>
</div>
<div>
<p class="yepnope">SUPPORTED!</p>
<code>
@supports (not (display: -ms-grid)) and (display: grid)
</code>
</div>
html, body {
margin: 0;
padding: 0;
height: 100%;
}
body {
display: flex;
flex-direction: column;
font-size: 1.4rem;
}
div {
flex-basis: 25%;
height: 100%;
background-color: red;
display: flex;
align-items: center;
border-bottom: 1px solid #000;
position: relative;
}
code {
margin: 0;
padding: 10px;
}
@supports(display: grid) {
div:nth-child(1) {
background-color: green;
.yepnope {
display: block;
}
}
}
@supports(display: -ms-grid) {
div:nth-child(2) {
background-color: green;
.yepnope {
display: block;
}
}
}
@supports (display: -ms-grid) and (display: grid) {
div:nth-child(3) {
background-color: green;
.yepnope {
display: block;
}
}
}
@supports (display: -ms-grid) and (not (display: grid)) {
div:nth-child(4) {
background-color: green;
.yepnope {
display: block;
}
}
}
@supports (not (display: -ms-grid)) and (display: grid) {
div:nth-child(5) {
background-color: green;
.yepnope {
display: block;
}
}
}
.yepnope {
position: absolute;
right: 0;
top:0;
background-color: rgba(0, 0, 0, 0.6);
color: #FFF;
margin: 0;
padding: 0.6rem;
display: none;
font-family: monospace
}
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.