Is it possible to create a gradient border on a CIRCLE with css3?

L N picture L N · Jul 13, 2015 · Viewed 21.1k times · Source

I have an background image in shape of a circle. Have given it a yellow border. I would like to change the border to a gradient from yellow to white. I have seen many examples with square borders but none applied to circles. Here's my code:

Thanks!!

Answer

hmak.me picture hmak.me · Jul 13, 2015

This Is Your Answer:

#cont{
  background: -webkit-linear-gradient(left top, crimson 0%, #f90 100%);
  width: 300px;
  height: 300px;
  border-radius: 1000px;
  padding: 10px;
}

#box{
  background: black;
  width: 300px;
  height: 300px;
  border-radius: 1000px;
}
<div id="cont">
  <div id="box"></div>
</div>