-
Notifications
You must be signed in to change notification settings - Fork 8k
/
index.md
59 lines (40 loc) · 1.77 KB
/
index.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
---
title: defs
slug: Web/SVG/Element/defs
---
{{SVGRef}}
SVG では、後で再利用できるよう描画オブジェクトを定義します。参照される要素は、可能なかぎり`defs`要素内で定義されることが推奨されています。`defs`要素内でこれらの要素を定義することは、SVG の要素の可読性を向上させ、ひいては操作性をも向上させます。`defs`要素の描画要素は、そのままでは描画されません。ビューポート上で描画したい場所へそれらの要素を描画するために、{{ SVGElement("use") }}要素を使用します。
## 利用コンテキスト
{{svginfo}}
## 例
```xml
<svg width="80px" height="30px" viewBox="0 0 80 30"
xmlns="http://www.w3.org/2000/svg">
<defs>
<linearGradient id="Gradient01">
<stop offset="20%" stop-color="#39F" />
<stop offset="90%" stop-color="#F3F" />
</linearGradient>
</defs>
<rect x="10" y="10" width="60" height="10"
fill="url(#Gradient01)" />
</svg>
```
## 属性
### グローバル属性
- [条件的処理属性(コンディショナルプロセッシング属性)](/ja/SVG/Attribute#ConditionalProccessing) »
- [コア属性](/ja/SVG/Attribute#Core) »
- [描画イベント属性](/ja/SVG/Attribute#GraphicalEvent) »
- [プレゼンテーション属性](/ja/SVG/Attribute#Presentation) »
- {{ SVGAttr("class") }}
- {{ SVGAttr("style") }}
- {{ SVGAttr("externalResourcesRequired") }}
- {{ SVGAttr("transform") }}
### スペシフィック属性
_スペシフィック属性はありません。_
## DOM インタフェース
この要素は [`SVGDefsElement`](/ja/DOM/SVGDefsElement) インタフェースを実装しています。
## 仕様
{{Specifications}}
## ブラウザ互換性
{{Compat}}