我试图将
!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'}} />
请检查您在样式属性中使用反引号
\'
,
<circle className="cls-1" cx="84.194" cy="83.49" r="83.48" style={{fill:'url(\'#linear-gradient !important\')', strokeWidth:'0px'}} />
另请确保
#linear-gradient
是有效元素。