--- title: margin-left slug: Web/CSS/margin-left tags: - CSS - CSS Referenz translation_of: Web/CSS/margin-left --- <p>{{ CSSRef() }}</p> <h2 id="Übersicht">Übersicht</h2> <p>Die <code>margin-left</code> Eigenschaft legt den linken Außenabstand eines Elements fest. Negative Werte sind erlaubt.</p> <ul> <li>Standardwert: <code>0</code></li> <li>Anwendbar auf: alle Elemente, in Tabellen nur auf Elemente mit <a href="/de/CSS/display" title="de/CSS/display">display</a> <code>table</code>, <code>table-caption</code> und <code>inline-table</code></li> <li>Vererbbar: Nein</li> <li>Prozentwerte: beziehen sich immer auf die <a href="/de/CSS/width" title="de/CSS/width">Breite</a> des umschließenden Blocks.</li> <li>Medium: visuell</li> <li>berechneter Wert: eine Prozentzahl wie festgelegt oder die absolute Länge.</li> </ul> <h2 id="Syntax">Syntax</h2> <pre class="eval">margin-left: <Längenangabe> | <Prozentzahl> | auto | inherit </pre> <h3 id="Werte">Werte</h3> <dl> <dt> <Längenangabe></dt> <dd> Legt eine bestimmte <a href="/de/CSS/Einheiten#L.c3.a4ngen" title="de/CSS/Einheiten#L.c3.a4ngen">Länge</a> fest. Negative Werte sind erlaubt.</dd> <dt> <Prozentzahl></dt> <dd> Ein <a href="/de/CSS/Einheiten#Prozent" title="de/CSS/Einheiten#Prozent">prozentualer</a> Wert, der sich auf die Breite des umschließenden Blocks (<em>containing block</em>) bezieht. Negative Werte sind erlaubt.</dd> <dt> auto</dt> <dd> <code>auto</code> wird von einem passendem Wert ersetzt, wobei die horizontalen bzw. vertikalen Dimensionen berücksichtigt werden.</dd> <dt> inherit</dt> <dd> Der Wert des Elternelements wird geerbt.</dd> </dl> <h2 id="Beispiele">Beispiele</h2> <pre>.content { margin-left: 5%; } .sidebox { margin-left: 10px; } .logo { margin-left: -5px; } </pre> <h2 id="Browser_Kompatibilität">Browser <span>Kompatibilität</span></h2> <table class="standard-table"> <tbody> <tr> <th>Browser</th> <th>ab Version</th> <th><code>auto</code> Wert</th> </tr> <tr> <td>Internet Explorer</td> <td>3.0</td> <td>6.0 (strict mode)</td> </tr> <tr> <td>Firefox (Gecko)</td> <td>1.0 (1.0)</td> <td>1.0 (1.0)</td> </tr> <tr> <td>Opera</td> <td>3.5</td> <td>3.5</td> </tr> <tr> <td>Safari (WebKit)</td> <td>1.0 (85)</td> <td>1.0 (85)</td> </tr> </tbody> </table> <h2 id="Spezifikation">Spezifikation</h2> <ul> <li><a class="external" href="http://www.w3.org/TR/CSS21/box.html#margin-properties" lang="en">CSS 2.1 Visual formatting #margin</a></li> </ul> <h2 id="Siehe_auch">Siehe auch</h2> <ul> <li><a href="/de/CSS/margin" title="de/CSS/margin"><code>margin</code></a>, <a href="/de/CSS/margin-right" title="de/CSS/margin-right"><code>margin-right</code></a>, <a href="/de/CSS/margin-bottom" title="de/CSS/margin-bottom"><code>margin-bottom</code></a>, <a href="/de/CSS/margin-top" title="de/CSS/margin-top"><code>margin-top</code></a></li> <li><a href="/de/CSS/-moz-margin-start" title="de/CSS/-moz-margin-start"><code>-moz-margin-start</code></a>, <a href="/de/CSS/-moz-margin-end" title="de/CSS/-moz-margin-end"><code>-moz-margin-end</code></a></li> <li><a href="/de/CSS/padding" title="de/CSS/padding"><code>padding</code></a></li> </ul> <p>{{ languages( { "en": "en/CSS/margin-left", "ja": "ja/CSS/margin-left" } ) }}</p>