I have a gradient I’m trying to make in CSS. I added the Figma settings and an image of the gradient.
This is the code I tried and just got a circle:
background: radial-gradient(circle, rgba(118, 60, 172, 1.00) 0%, rgba(50, 15, 133, 0) 100%);
body {
background-color: #000;
}
.circle {
width: 300px;
height: 300px;
background: radial-gradient(circle, rgba(118, 60, 172, 1.00) 0%, rgba(50, 15, 133, 0) 100%);
}
<div class="circle"></div>
2
Answers
Just leave a little space for the radial gradient, so it doesn’t end at 100%, but sooner.
Don’t use
circle
but define the radii values to be equal to50%
. You can also omit the percentage of the color stops.