aboutsummaryrefslogtreecommitdiff
path: root/files/ja/web/css/shape-margin/index.html
blob: 439251b5b48048fb5665899e58247f127784c85a (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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
---
title: shape-margin
slug: Web/CSS/shape-margin
tags:
  - CSS
  - CSS シェイプ
  - CSS プロパティ
  - Reference
  - float
  - margin
  - shape-margin
  - シェイプ
  - プロパティ
  - 境界
  - 浮動領域
translation_of: Web/CSS/shape-margin
---
<div>{{CSSRef}}</div>

<p><span class="seoSummary"><a href="/ja/docs/Web/CSS">CSS</a><strong><code>shape-margin</code></strong> プロパティは、 {{cssxref("shape-outside")}} を使用して作成された CSS シェイプのマージンを設定します。</span></p>

<div>{{EmbedInteractiveExample("pages/css/shape-margin.html")}}</div>

<p class="hidden">このデモのソースファイルは GitHub リポジトリに格納されています。デモプロジェクトに協力したい場合は、 <a href="https://github.com/mdn/interactive-examples">https://github.com/mdn/interactive-examples</a> をクローンしてプルリクエストを送信してください。</p>

<p>マージンで、シェイプ (<strong>浮動要素</strong>) の縁と周囲のコンテンツとの間隔を調整することができます。</p>

<h2 id="Syntax" name="Syntax">構文</h2>

<pre class="brush:css no-line-numbers">/* &lt;length&gt; 値 */
shape-margin: 10px;
shape-margin: 20mm;

/* &lt;percentage&gt; 値 */
shape-margin: 60%;

/* グローバル値 */
shape-margin: inherit;
shape-margin: initial;
shape-margin: unset;
</pre>

<h3 id="Values" name="Values"></h3>

<dl>
 <dt><code>&lt;length-percentage&gt;</code></dt>
 <dd>シェイプのマージンを {{cssxref("&lt;length&gt;")}} 値又は要素の内包ブロックの幅に対する {{cssxref("&lt;percentage&gt;")}} で設定します。</dd>
</dl>

<h3 id="Formal_syntax" name="Formal_syntax">形式文法</h3>

{{csssyntax}}

<h2 id="Example" name="Example"></h2>

<h3 id="HTML">HTML</h3>

<pre class="brush: html">&lt;section&gt;
&lt;div class="shape"&gt;&lt;/div&gt;
We are not quite sure of any one thing in biology; our knowledge of geology
is relatively very slight, and the economic laws of society are
uncertain to every one except some individual who attempts to set them
forth; but before the world was fashioned the square on the hypotenuse
was equal to the sum of the squares on the other two sides of a right
triangle, and it will be so after this world is dead; and the inhabitant
of Mars, if he exists, probably knows its truth as we know it.&lt;/section&gt;</pre>

<h3 id="CSS">CSS</h3>

<pre class="brush: css">section {
  max-width: 400px;
}

.shape {
  float: left;
  width: 150px;
  height: 150px;
  background-color: maroon;
  clip-path: polygon(0 0, 150px 150px, 0 150px);
  shape-outside: polygon(0 0, 150px 150px, 0 150px);
  shape-margin: 20px;
}</pre>

<h3 id="Result" name="Result">結果</h3>

<p>{{EmbedLiveSample("Example", 500, 250)}}</p>

<h2 id="Specifications" name="Specifications">仕様書</h2>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">仕様書</th>
   <th scope="col">状態</th>
   <th scope="col">備考</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{SpecName('CSS Shapes', '#shape-margin-property', 'shape-margin')}}</td>
   <td>{{Spec2('CSS Shapes')}}</td>
   <td>初回定義</td>
  </tr>
 </tbody>
</table>

<p>{{cssinfo}}</p>

<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2>

<div>
<p class="hidden">このページの互換性一覧表は構造化データから生成されています。データに協力していただけるのであれば、 <a class="external" href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> をチェックアウトしてプルリクエストを送信してください。</p>

<p>{{Compat("css.properties.shape-margin")}}</p>
</div>

<h2 id="See_also" name="See_also">関連情報</h2>

<ul>
 <li><a href="/ja/docs/Web/CSS/CSS_Shapes">CSS シェイプ</a></li>
 <li><a href="/ja/docs/Web/CSS/CSS_Shapes/Overview_of_CSS_Shapes">CSS シェイプの概要</a></li>
 <li>{{cssxref("shape-outside")}}</li>
 <li>{{cssxref("shape-image-threshold")}}</li>
 <li>{{cssxref("&lt;basic-shape&gt;")}}</li>
</ul>