aboutsummaryrefslogtreecommitdiff
path: root/files/es/web/css/margin-block/index.html
blob: 680b41219d9e6f8a7be899666333dfd3db02b1fd (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
---
title: margin-block
slug: Web/CSS/margin-block
translation_of: Web/CSS/margin-block
---
<p>{{CSSRef}}{{SeeCompatTable}}  </p>

<p>La propiedad de <a href="/en-US/docs/Web/CSS" title="CSS">CSS</a> <strong><code>margin-block</code></strong> define el bloque lógico de inicio y fin de las márgenes de un elemento, que se asigna a las márgenes físicas en función del modo de escritura del elemento, la direccionalidad y la orientación del texto.</p>

<pre class="brush:css no-line-numbers notranslate">/* &lt;length&gt; values */
margin-block: 10px 20px;  /* An absolute length */
margin-block: 1em 2em;   /* relative to the text size */
margin-block: 5% 2%;    /* relative to the nearest block container's width */
margin-block: 10px; /* sets both start and end values */

/* Keyword values */
margin-block: auto;

/* Global values */
margin-block: inherit;
margin-block: initial;
margin-block: unset;
</pre>



<p>Estos valores corresponden a {{CSSxRef("margin-top")}} y  {{CSSxRef("margin-bottom")}}, o {{CSSxRef("margin-right")}}, y {{CSSxRef("margin-left")}} depende de los valores definidos para {{CSSxRef("writing-mode")}}, {{CSSxRef("direction")}}, y {{CSSxRef("text-orientation")}}.</p>

<h2 id="Propiedades_que_lo_constituyen">Propiedades que lo constituyen</h2>

<p>Los valores se pueden establecer individualmente como {{CSSxRef("margin-block-start")}} y {{CSSxRef("margin-block-end")}}. La propiedad de dirección en línea es {{CSSxRef("margin-inline")}} que establece {{CSSxRef("margin-inline-start")}}, y {{CSSxRef("margin-inline-end")}}.</p>

<h2 id="Sintaxis">Sintaxis</h2>

<h3 id="Valores">Valores</h3>

<p>La propiedad <code>margin-block</code> toma los mismos valores de la propiedad {{CSSxRef("margin-left")}}.</p>

<h3 id="Definición_formal">Definición formal</h3>

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

<h3 id="Sintaxis_formal">Sintaxis formal</h3>

<pre class="syntaxbox notranslate">{{CSSSyntax}}</pre>

<h2 id="Ejemplo">Ejemplo</h2>

<h3 id="Definiendo_el_comienzo_del_bloque_y_el_fin_de_los_margenes">Definiendo el comienzo del bloque y el fin de los margenes</h3>

<h4 id="HTML"><strong>HTML</strong></h4>

<pre class="brush: html notranslate">&lt;div&gt;
  &lt;p class="exampleText"&gt;Example text&lt;/p&gt;
&lt;/div&gt;
</pre>

<h4 id="CSS"><strong>CSS</strong></h4>

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

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

<h4 id="Resultado"><strong>Resultado</strong></h4>

<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-block", "margin-block")}}</td>
   <td>{{Spec2("CSS Logical Properties")}}</td>
   <td>Definición inicial.</td>
  </tr>
 </tbody>
</table>

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

<h2 id="Compatibilidad_en_navegadores">Compatibilidad en navegadores</h2>



<p>{{Compat("css.properties.margin-block")}}</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>