W3cubDocs

/SVG

Styling

The SVG styling attributes are all the attributes that can be specified on any SVG element to apply CSS styling effects.

Attributes

class
Assigns a class name or set of class names to an element. It functions identically to the class attribute in HTML.
Value: Any valid ID string; Animatable: Yes
style
It specifies style information for its element. It functions identically to the style attribute in HTML.
Value: Any valid style string; Animatable: No

Browser compatibilityUpdate compatibility data on GitHub

Desktop
Chrome Edge Firefox Internet Explorer Opera Safari
class Yes 12 Yes Yes Yes Yes
style Yes 12 Yes Yes Yes Yes
Mobile
Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
class Yes Yes Yes Yes Yes Yes
style Yes Yes Yes Yes Yes Yes

© 2005–2020 Mozilla and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/Styling