blob: c0cf0023413dee15907623428b10f4dd553890e2 (
plain)
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
|
---
title: viewBox
slug: Web/SVG/Attribute/viewBox
translation_of: Web/SVG/Attribute/viewBox
---
<p>« <a href="/en/SVG/Attribute" title="en/SVG/Attribute">SVG Attribute reference home</a></p>
<p><code>viewBox</code>属性は、特定のcontainer要素に合わせるためのグラフィックス stretchのセットを指定できます。</p>
<p>The value of the <code>viewBox</code> attribute is a list of four numbers <code>min-x</code>, <code>min-y</code>, <code>width</code> and <code>height</code>, separated by whitespace and/or a comma, which specify a rectangle in user space which should be mapped to the bounds of the viewport established by the given element, taking into account attribute {{ SVGAttr("preserveAspectRatio") }}.</p>
<p>Negative values for <code>width</code> or <code>height</code> are not permitted and a value of zero disables rendering of the element.</p>
<h2 id="Usage_context">Usage context</h2>
<table class="standard-table">
<tbody>
<tr>
<th scope="row">Categories</th>
<td>None</td>
</tr>
<tr>
<th scope="row">Value</th>
<td><em>See above</em></td>
</tr>
<tr>
<th scope="row">Animatable</th>
<td>Yes</td>
</tr>
<tr>
<th scope="row">Normative document</th>
<td><a class="external" href="http://www.w3.org/TR/SVG11/coords.html#ViewBoxAttribute" title="http://www.w3.org/TR/SVG11/coords.html#ViewBoxAttribute">SVG 1.1 (2nd Edition)</a></td>
</tr>
</tbody>
</table>
<h2 id="例">例</h2>
<h2 id="要素">要素</h2>
<p>以下の要素が<code>viewBox</code>属性を使います。</p>
<ul>
<li>{{ SVGElement("svg") }}</li>
<li>{{ SVGElement("symbol") }}</li>
<li>{{ SVGElement("marker") }}</li>
<li>{{ SVGElement("pattern") }}</li>
<li>{{ SVGElement("view") }}</li>
</ul>
<h2 id="See_also">See also</h2>
<ul>
<li><a href="/en/SVG/Tutorial/Positions" title="https://developer.mozilla.org/en/SVG/Tutorial/Positions">SVG Getting Started: Positions</a></li>
</ul>
|