我试图使用clippath绘制一颗星,但在IE11中,该形状显示为一个简单的方块。这有什么解决方案吗?
https://jsfiddle.net/sleepydada/mh4bcbcf/
HTML:
<div id="image-wrapper">
<div class="background"></div>
</div>
<svg id="svg-defs">
<defs>
<clipPath id="clip-triangle" clipPathUnits="objectBoundingBox">
<polygon points=".5 0, .65 .35, .98 .35, .69 .58, .79 .91, .5 .7, .21 .91, .28 .56, .02 .35, .34 .35" />
</clipPath>
</defs>
</svg>
CSS:
body {
background-color: #e0e0e0;
}
#image-wrapper {
position: relative;
background: black;
clip-path: url(#clip-triangle);
width: 210px;
height: 210px
}
.background {
position: absolute;
top: 5px;
left: 5px;
width: 200px;
height: 200px;
background: white;
clip-path: url(#clip-triangle);
}