SVG 屬性參考

SVG 元素可以透過屬性來修改,這些屬性指定了關於元素應該如何被處理或渲染的詳細資訊。

下面列出了 SVG 中所有可用的屬性,並附有參考文件的連結,以幫助你瞭解哪些元素支援它們以及它們如何工作。

SVG 屬性 A 到 Z

A

B

C

D

E

F

G

H

I

K

L

M

N

O

P

R

S

T

U

V

W

X

Y

Z

按類別劃分的 SVG 屬性

核心屬性

核心屬性是全域性屬性。

條件處理屬性

條件處理屬性控制其出現的元素是否被處理。

XLink 屬性可以引用資源。

呈現屬性

所有 SVG 呈現屬性都可以用作 CSS 屬性。

注意:這些屬性是否為呈現屬性取決於它們所設定的元素。例如,對於不支援的模板: svgelemx 是一個呈現屬性,但對於不支援的模板: svgelem則不是;它是文字基線的起始點的座標,如果提供了值列表,則為每個單獨字形的 x 座標。

濾鏡屬性

濾鏡基元屬性(呈現屬性)

height, result, width, x, y

傳遞函式屬性

type, tableValues, slope, intercept, amplitude, exponent, offset

動畫屬性

動畫目標元素屬性
href
動畫屬性目標屬性

attributeType, attributeName

動畫時間屬性

begin, dur, end, min, max, restart, repeatCount, repeatDur, fill

動畫值屬性

calcMode, values, keyTimes, keySplines, from, to, by

動畫新增屬性

additive, accumulate

事件屬性

  • onabort
  • onactivate
  • onbegin
  • oncancel
  • oncanplay
  • oncanplaythrough
  • onchange
  • onclick
  • onclose
  • oncuechange
  • ondblclick
  • ondrag
  • ondragend
  • ondragenter
  • ondragleave
  • ondragover
  • ondragstart
  • ondrop
  • ondurationchange
  • onemptied
  • onend
  • onended
  • onerror
  • onfocus
  • onfocusin
  • onfocusout
  • oninput
  • oninvalid
  • onkeydown
  • onkeypress
  • onkeyup
  • onload
  • onloadeddata
  • onloadedmetadata
  • onloadstart
  • onmousedown
  • onmouseenter
  • onmouseleave
  • onmousemove
  • onmouseout
  • onmouseover
  • onmouseup
  • onmousewheel
  • onpause
  • onplay
  • onplaying
  • onprogress
  • onratechange
  • onrepeat
  • onreset
  • onresize
  • onscroll
  • onseeked
  • onseeking
  • onselect
  • onshow
  • onstalled
  • onsubmit
  • onsuspend
  • ontimeupdate
  • ontoggle
  • onunload
  • onvolumechange
  • onwaiting

另見