我有一个SVG li::标记,我想根据字体 colored颜色 更改 colored颜色 .我想这样使用它,我把fill="currentColor"放在这里,但这不起作用.我怎样才能解决这个问题?
li::marker {
content: url("data:image/svg+xml,%3Csvg width='5' height='8' viewBox='0 0 5 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0.942666 7.60933L4.74733 3.80467L0.942666 0L0 0.942666L2.862 3.80467L0 6.66667L0.942666 7.60933Z' fill='currentColor'/%3E%3C/svg%3E%0A");
}
我还try 导入带有URL的图标,但相同:
li::marker {
content: url(/assets/images/icons/list-marker.svg);
}
<svg width="5" height="8" viewBox="0 0 5 8" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0.942666 7.60933L4.74733 3.80467L0.942666 0L0 0.942666L2.862 3.80467L0 6.66667L0.942666 7.60933Z" fill="currentColor"/>
</svg>
谢谢