0

I want to make semicircle in svg by appliying attr function of css.
I have tried this till now. I think attr() function of css is not working

<?xml version="1.0" standalone="no" ?>
<svg width="100" height="100">
  <style>
    circle.semiCircle1 {
      stroke-dasharray: calc( (2 * (22/7) * attr(r)) / 2 ); /* 44 */
    }
    circle.semiCircle2 {
      stroke-dasharray: 44;
    }
  </style>
  <circle class="semiCircle1" cx="25" cy="50" r="14" stroke-width="3" stroke="#000" fill="transparent" />
  <circle class="semiCircle2" cx="75" cy="50" r="14" stroke-width="3" stroke="#000" fill="transparent" />
</svg>
vaku
  • 697
  • 8
  • 17

0 Answers0