<div class="card">
<h1>farthest-corner</h1>
</div>
<div class="card">
<h1>closest-side</h1>
</div>
<div class="card">
<h1>closest-corner</h1>
</div>
<div class="card">
<h1>farthest-side</h1>
</div>
body {
display: grid;
grid-gap: 30px;
grid-template-columns: repeat(4, 200px);
width: 100vw;
height: 100vh;
margin: 20px 0 0 20px;
padding: 0;
font: 14px/1.5 monospace;
}
h1 {
font-size: inherit;
}
.card {
width: 200px;
height: 300px;
padding: 30px;
box-sizing: border-box;
border-radius: 10px;
color: #fff;
}
.card:nth-child(1) {
background: radial-gradient(farthest-corner, #f44336, #000732);
}
.card:nth-child(2) {
background: radial-gradient(closest-side, #f44336, #000732);
}
.card:nth-child(3) {
background: radial-gradient(closest-corner, #f44336, #000732);
}
.card:nth-child(4) {
background: radial-gradient(farthest-side, #f44336, #000732);
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.