aboutsummaryrefslogtreecommitdiff
path: root/files/ja/web/css/margin-inline/index.md
blob: 67f51f34b84a6310823d202b1cd6f1729584f3f9 (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
---
title: margin-inline
slug: Web/CSS/margin-inline
tags:
  - CSS
  - CSS Logical Property
  - CSS Property
  - CSS プロパティ
  - CSS 論理的プロパティ
  - Experimental
  - Reference
  - margin-inline
  - margin-inline-end
  - margin-inline-start
translation_of: Web/CSS/margin-inline
---
<div>{{CSSRef}}{{SeeCompatTable}}</div>

<p>The <strong><code>margin-inline</code></strong> は <a href="/ja/docs/Web/CSS" title="CSS">CSS</a> のプロパティで、論理的なインライン方向の先頭と末尾のマージンを設定します。これは要素の書字方向やテキストの向きに応じて物理的なマージンに変換されます。</p>

<pre class="brush:css no-line-numbers">/* &lt;length&gt; 値 */
margin-inline: 10px 20px;  /* 絶対的な長さ */
margin-inline: 1em 2em;    /* テキストの大きさに対する相対値 */
margin-inline: 5% 2%;      /* 直近のブロックコンテナーの大きさに対する相対値 */
margin-inline: 10px; /* 先頭と末尾の両方を設定 */

/* キーワード値 */
margin-inline: auto;

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

<p>これらの値は、 {{CSSxRef("margin-top")}} と {{CSSxRef("margin-bottom")}}、または {{CSSxRef("margin-right")}} と {{CSSxRef("margin-left")}} プロパティに、 {{CSSxRef("writing-mode")}}, {{CSSxRef("direction")}}, {{CSSxRef("text-orientation")}} で定義された値にしたがって対応します。</p>

<p>値は {{CSSxRef("margin-inline-start")}} と {{CSSxRef("margin-inline-end")}} で個別に設定することができます。ブロック方向のプロパティは {{CSSxRef("margin-block")}} で、 {{CSSxRef("margin-block-start")}} と {{CSSxRef("margin-block-end")}} を設定します。</p>

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

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

<p><code>margin-inline</code> プロパティは、 {{CSSxRef("margin-left")}} プロパティと同じ値を取ります。</p>

<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;div&gt;
  &lt;p class="exampleText"&gt;Example text&lt;/p&gt;
&lt;/div&gt;
</pre>

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

<pre class="brush: css">div {
  background-color: yellow;
  width: 120px;
  height: 120px;
}

.exampleText {
  writing-mode: vertical-rl;
  margin-inline: 20px 40px;
  background-color: #c8c800;
}</pre>

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

<h2 id="Specification" name="Specification">仕様書</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 Logical Properties", "#propdef-margin-inline", "margin-inline")}}</td>
   <td>{{Spec2("CSS Logical Properties")}}</td>
   <td>初回定義</td>
  </tr>
 </tbody>
</table>

<p>{{CSSInfo}}</p>

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

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

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

<ul>
 <li>対応する物理的プロパティ: {{CSSxRef("margin-top")}}, {{CSSxRef("margin-right")}}, {{CSSxRef("margin-bottom")}}, {{CSSxRef("margin-left")}}</li>
 <li>{{CSSxRef("writing-mode")}}, {{CSSxRef("direction")}}, {{CSSxRef("text-orientation")}}</li>
</ul>