--- title: margin-inline slug: Web/CSS/margin-inline translation_of: Web/CSS/margin-inline --- <p>{{CSSRef}}{{SeeCompatTable}} </p> <p>La propiedad de <a href="/en-US/docs/Web/CSS" title="CSS">CSS</a> <strong><code>margin-inline</code></strong> define los márgenes lógicos de inicio y final en línea de un elemento, que se asignan a márgenes físicos según el modo de escritura, la direccionalidad y la orientación del texto del elemento.</p> <pre class="brush:css no-line-numbers notranslate">/* Valores <largo> */ margin-inline: 10px 20px; /* Un largo absoluto */ margin-inline: 1em 2em; /* relativo al tamaño del texto */ margin-inline: 5% 2%; /* relativo al ancho del container del bloque más cercano */ margin-inline: 10px; /* settear tanto el valor inicial como el final*/ /* Valores keyword */ margin-inline: auto; /* Valores globales */ margin-inline: inherit; margin-inline: initial; margin-inline: unset; </pre> <p>Estos valores corresponden a las propiedades {{CSSxRef("margin-top")}} y {{CSSxRef("margin-bottom")}}, o {{CSSxRef("margin-right")}}, y {{CSSxRef("margin-left")}} dependiendo de los valores definidos por {{CSSxRef("writing-mode")}}, {{CSSxRef("direction")}}, y {{CSSxRef("text-orientation")}}.</p> <p>Los valores pueden ser establecidos indibidualmente como {{CSSxRef("margin-inline-start")}} y {{CSSxRef("margin-inline-end")}}. La propiedad de dirección de bloque es {{CSSxRef("margin-block")}} que establece {{CSSxRef("margin-block-start")}}, y {{CSSxRef("margin-block-end")}}.</p> <h2 id="Sintaxis">Sintaxis</h2> <h3 id="Valores">Valores</h3> <p>La propiedad <code>margin-inline</code> toma los mismos valores de la propiedad {{CSSxRef("margin-left")}}.</p> <h3 id="Sintaxis_formal">Sintaxis formal</h3> {{CSSSyntax}} <h2 id="Ejemplo">Ejemplo</h2> <h3 id="Contenido_HTML">Contenido HTML</h3> <pre class="brush: html notranslate"><div> <p class="exampleText">Texto de ejemplo</p> </div> </pre> <h3 id="Contenido_CSS">Contenido CSS</h3> <pre class="brush: css notranslate">div { background-color: yellow; width: 120px; height: 120px; } .exampleText { writing-mode: vertical-rl; margin-inline: 20px 40px; background-color: #c8c800; }</pre> <p>{{EmbedLiveSample("Ejemplo", 140, 140)}}</p> <h2 id="Especificación">Especificación</h2> <table class="standard-table"> <thead> <tr> <th scope="col">Especificación</th> <th scope="col">Estado</th> <th scope="col">Comentario</th> </tr> </thead> <tbody> <tr> <td>{{SpecName("CSS Logical Properties", "#propdef-margin-inline", "margin-inline")}}</td> <td>{{Spec2("CSS Logical Properties")}}</td> <td>Definición inicial.</td> </tr> </tbody> </table> <p id="Browser_compatibility">{{CSSInfo}}</p> <h2 id="Compatibilidad_en_navegadores">Compatibilidad en navegadores</h2> <p>{{Compat("css.properties.margin-inline")}}</p> <h2 id="Mira_también">Mira también</h2> <ul> <li>Las propiedades físicas mapeadas: {{CSSxRef("margin-top")}}, {{CSSxRef("margin-right")}}, {{CSSxRef("margin-bottom")}}, y {{CSSxRef("margin-left")}}</li> <li>{{CSSxRef("writing-mode")}}, {{CSSxRef("direction")}}, {{CSSxRef("text-orientation")}}</li> </ul>