style

由 2 位貢獻者:
Our volunteers haven't translated this article into 正體中文 (繁體) yet. Join us and help get the job done!

« 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)
<style>
The syntax of style data depends on the style sheet language. By default, if contentStyleType is not defined, the style sheet language is CSS.

Example

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="http://www.w3.org/2000/svg">
  <rect height="300" width="600" x="200" y="100" 
     style="fill: red; stroke: blue; stroke-width: 3"/>
</svg>

Elements

The following elements can use the style attribute

Document Tags and Contributors

Contributors to this page: Jeremie, pa7
最近更新: Jeremie,