How can I create a "ring" shape with a specific thickness (in pixels) using radial gradient in HTML and CSS? I want to achieve a smooth color transition from green to transparent, like this:
https://i.sstatic.net/mF54O.png
Currently, my code only produces a solid circle without the desired thickness. Here is what I have so far:
div {
background-image: radial-gradient(transparent, green, transparent);
border-radius: 100%;
height: 300px;
width: 300px;
}
<div></div>
I am looking for a solution using only HTML and CSS, without resorting to canvas or SVG (fiddle). I need the flexibility to adjust the width and thickness of the ring shape dynamically without relying on an image.