<div data-gradient="Linear Gradients"></div>
<div data-gradient="Opposing Corner Radial Gradients"></div>
@import url("https://fonts.googleapis.com/css2?family=Exo:wght@600&display=swap");
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
width: 100vw;
min-height: 100vh;
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
padding: 10px 10px 30px;
gap: 30px 10px;
font-family: "Exo", Arial, sans-serif;
background-color: #222;
color: #fff;
}
:root {
--cyanHSL: hsl(180 100% 50%);
--pinkHSL: hsl(328 100% 54%);
}
div {
border-radius: 5px;
border: 1px solid #efefef;
min-height: 40vh;
position: relative;
}
div:nth-of-type(1) {
background-image: linear-gradient(
to top right,
var(--cyanHSL),
var(--pinkHSL)
);
}
div:nth-of-type(2) {
background-image: radial-gradient(
circle at left bottom,
var(--cyanHSL),
var(--pinkHSL)
),
radial-gradient(circle at top right, var(--cyanHSL), var(--pinkHSL));
}
div::after {
content: attr(data-gradient);
position: absolute;
top: calc(100% + 5px);
white-space: nowrap;
left: 50%;
transform: translate(-50%, 0);
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.