--- title: margin-inline-start slug: Web/CSS/margin-inline-start tags: - CSS - CSS Logical Property - CSS Property - CSS プロパティ - CSS 物理的プロパティ - Experimental - Reference - margin-inline - margin-inline-start translation_of: Web/CSS/margin-inline-start --- <div>{{CSSRef}}{{SeeCompatTable}}</div> <p><strong><code>margin-inline-start</code></strong> は <a href="/ja/docs/Web/CSS" title="CSS">CSS</a> のプロパティで、要素のインライン方向の論理的な先頭側のマージンを定義し、それが要素の書字方向やテキストの方向に応じて物理的なマージンに対応付けられます。これは {{cssxref("margin-top")}}, {{cssxref("margin-right")}}, {{cssxref("margin-bottom")}}, {{cssxref("margin-left")}} の何れかのプロパティに対応し、どれに対応するかは {{cssxref("writing-mode")}}, {{cssxref("direction")}}, {{cssxref("text-orientation")}} で定義された値によって決まります。</p> <div>{{EmbedInteractiveExample("pages/css/margin-inline-start.html")}}</div> <p class="hidden">このデモのソースファイルは GitHub リポジトリに格納されています。デモプロジェクトに協力したい場合は、 <a href="https://github.com/mdn/interactive-examples">https://github.com/mdn/interactive-examples</a> をクローンしてプルリクエストを送信してください。</p> <h2 id="Syntax" name="Syntax">構文</h2> <pre class="brush:css no-line-numbers">/* <length> 値 */ margin-inline-start: 10px; /* 絶対的な長さ */ margin-inline-start: 1em; /* テキストの大きさに対する相対値 */ margin-inline-start: 5%; /* 直近のブロックコンテナーの大きさに対する相対値 */ /* キーワード値 */ margin-inline-start: auto; /* グローバル値 */ margin-inline-start: inherit; </pre> <p>関連プロパティとして、要素の他のマージンを定義する {{cssxref("margin-block-start")}}, {{cssxref("margin-block-end")}}, {{cssxref("margin-inline-end")}} があります。</p> <p>{{cssinfo}}</p> <h3 id="Values" name="Values">値</h3> <p><code>margin-inline-start</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"><div> <p class="exampleText">Example text</p> </div> </pre> <h3 id="CSS">CSS</h3> <pre class="brush: css">div { background-color: yellow; width: 120px; height: 120px; } .exampleText { writing-mode: vertical-lr; margin-inline-start: 20px; 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-start", "margin-inline-start")}}</td> <td>{{Spec2("CSS Logical Properties")}}</td> <td>初回定義</td> </tr> </tbody> </table> <h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2> <p>{{Compat("css.properties.margin-inline-start")}}</p> <h2 id="See_also" name="See_also">関連情報</h2> <ul> <li>{{cssxref("margin-inline-end")}}</li> <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>