应用!对SVG填充属性很重要

问题描述 投票:0回答:1

我试图将

!important
应用于 SVG 文件的填充属性,但似乎这里的语法是错误的,
!important
未应用于填充属性,并且
circle
元素呈现为黑色。

我想知道如何在react中将

!important
应用于SVG的填充属性

<circle className="cls-1" cx="84.194" cy="83.49" r="83.48" style={{fill:'url(\'#linear-gradient\ !important')', strokeWidth:'0px'}} />
css reactjs svg
1个回答
0
投票

请检查您在样式属性中使用反引号

\'

<circle className="cls-1" cx="84.194" cy="83.49" r="83.48" style={{fill:'url(\'#linear-gradient !important\')', strokeWidth:'0px'}} />

另请确保

#linear-gradient
是有效元素。

© www.soinside.com 2019 - 2024. All rights reserved.