I have this code:
<div id="circle" style="
width: 500px;
height: 500px;
border-color: gold;
border-style: solid;
border-bottom-style: none;
border-left-style: none;
border-radius: 50%;
background-color: transparent;
position: absolute;
">
</div>
that creates this image:
How do I make the border have a gradient (e.g. going from gold to black to red)? I need to keep the center transparent so using a div inside another div isn’t really an option
2
Answers
Gradient borders do not exist as a thing in their own right. I can’t find a way to have a decent border gradient and a transparent background but if you can compromise one of the following might suffice.
EDIT: I’ve just noticed your requirement for the gradient to go gold/black/red so option one below is out (but I’ve kept it because its actually not a bad effect).
#0000
) to gold (#fd0
) at 45 degreesmask-image
:This way your body’s background colors or image will be visible thanks to the masking method.