MDN wants to talk to developers like you:

style Redirect 3

« SVG Attribute reference home

This attribute specifies style information for the current element. The style attribute specifies style information for a single element. The style sheet language of inline style rules is given by the value of attribute contentStyleType on the <svg> element.

Usage context

Categories Presentation attribute
Value <style>
Animatable No
Normative document SVG 1.1 (2nd Edition)
The syntax of style data depends on the style sheet language. By default, if contentStyleType is not defined, the style sheet language is CSS.


The following example shows styling of a rectangle with the style attribute using CSS as style sheet language.

<svg version="1.1" viewbox="0 0 1000 500" xmlns="">
  <rect height="300" width="600" x="200" y="100" 
     style="fill: red; stroke: blue; stroke-width: 3"/>


The following elements can use the style attribute

Document Tags and Contributors

 Last updated by: Jeremie,