Rotate rectangle around its own center in SVG

前端 未结 5 1554
孤独总比滥情好
孤独总比滥情好 2020-12-05 08:59

I have following piece of code :






        
5条回答
  •  生来不讨喜
    2020-12-05 09:47

    You would have to set the center as the center of the filled element. Like this:

    svg .rotate {
      transform-box: fill-box;
      transform-origin: center;
      transform: rotate(45deg);
    }
    

提交回复
热议问题