SVG样式属性

SVG样式属性是所有可以在任何SVG元素上指定以应用CSS样式效果的属性。

属性

class
给一个元素分配一个类名称或者设置类名。它跟 HTML中的class属性具有同样的功能。
Value: 任何可用的ID字符; Animatable: Yes
style
它指定元素的样式信息。它跟HTML中 style属性具有相同的功能。
Value:任何可用的ID字符; Animatable: No

 

浏览器支持

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
classChrome Full support YesEdge Full support YesFirefox Full support YesIE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
styleChrome Full support YesEdge Full support YesFirefox Full support YesIE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes

Legend

Full support  
Full support