【发布时间】:2019-01-02 21:51:08
【问题描述】:
我正在尝试让一个矩形 <clipPath> 剪辑一个 SVG 元素中的 <circle>,但我似乎无法让它工作。
有谁知道问题出在哪里?
非常感谢您的任何帮助。
Codepen:https://codepen.io/emilychews/pen/jpLMaV
嗯
#circle {width: 10rem;}
<defs>
<clipPath id="myClipPath">
<rect x="30" y="30" width="100" height="100"/>
</clipPath>
</defs>
<svg id="circle" style="clip-path: url(#myClipPath)" viewBox="0 0 391 391">
<circle fill="#000" cx="195.5" cy="195.5" r="195"/>
</svg>
【问题讨论】: