<div data-gradient-type="radial-gradient"></div>
<div data-gradient-type="radial-gradient"></div>
<div data-gradient-type="repeating-radial-gradient"></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;
font-family: "Exo", Arial, sans-serif;
background-color: #222;
color: #fff;
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 36px 10px;
padding: 10px 10px 36px;
font-size: 1.5rem;
}
div {
min-height: 30vh;
border-radius: 5px;
box-shadow: 0 0 2px rgba(255, 255, 255, 0.3);
position: relative;
}
div::after {
content: attr(data-gradient-type) "()";
position: absolute;
left: 5px;
right: 5px;
top: calc(100% + 5px);
text-align: center;
font-size: 12px;
}
div:nth-of-type(1) {
background-image: radial-gradient(
circle at center,
red 25%,
gold 25%,
gold 50%,
red 50%,
red 75%,
gold 0
);
}
div:nth-of-type(2) {
background-image: radial-gradient(
circle at center,
red 25%,
gold 25%,
gold 50%,
red 50%,
red 75%,
gold 0
);
background-size: 20% 20%;
}
div:nth-of-type(3) {
background-image: repeating-radial-gradient(
circle at center,
red,
red 20px,
gold 20px,
gold 40px
);
}
div:nth-of-type(2)::after {
content: attr(data-gradient-type) "() & background-size";
}
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.