Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to create a right triangle gradient

I am trying to create this as a gradient. https://jsfiddle.net/ojscg6fn/

enter image description here

I have a circle here, how do I create a right triangle gradient to place in the middle of the
circle?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

https://jsfiddle.net/79mjuhb2/

enter image description here

.play {
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  width: 90px;
  height: 90px;
  cursor: pointer;
  /*background:
    linear-gradient(green 0 0),
    linear-gradient(green 0 0)
    blue;*/
  background-size:7px 100%,100% 7px;
  background-position:center;
  background-repeat:no-repeat;
  border: 9px solid red;
  border-radius: 50%;
  transform: rotate(45deg);
  }
<button class="play" type="button" aria-label="Close"></button>

>Solution :

Use a conic-gradient

.play {
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  width: 90px;
  height: 90px;
  cursor: pointer;
  background: conic-gradient(from -135deg at right,red 90deg,#0000 0) 55% 50%/22px 44px no-repeat;
  border: 9px solid red;
  border-radius: 50%;
  }
<button class="play" type="button" aria-label="Close"></button>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading