diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:41:45 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:41:45 -0500 |
commit | 1109132f09d75da9a28b649c7677bb6ce07c40c0 (patch) | |
tree | 0dd8b084480983cf9f9680e8aedb92782a921b13 /files/es/web/css/flex-shrink/index.html | |
parent | 4b1a9203c547c019fc5398082ae19a3f3d4c3efe (diff) | |
download | translated-content-1109132f09d75da9a28b649c7677bb6ce07c40c0.tar.gz translated-content-1109132f09d75da9a28b649c7677bb6ce07c40c0.tar.bz2 translated-content-1109132f09d75da9a28b649c7677bb6ce07c40c0.zip |
initial commit
Diffstat (limited to 'files/es/web/css/flex-shrink/index.html')
-rw-r--r-- | files/es/web/css/flex-shrink/index.html | 185 |
1 files changed, 185 insertions, 0 deletions
diff --git a/files/es/web/css/flex-shrink/index.html b/files/es/web/css/flex-shrink/index.html new file mode 100644 index 0000000000..01d3740fd3 --- /dev/null +++ b/files/es/web/css/flex-shrink/index.html @@ -0,0 +1,185 @@ +--- +title: flex-shrink +slug: Web/CSS/flex-shrink +translation_of: Web/CSS/flex-shrink +--- +<div>{{CSSRef}}</div> + +<p>La propiedad <a href="/en-US/docs/CSS" title="CSS">CSS</a> <strong><code>flex-shrink</code></strong> especifica el factor de contracción de un flex item. Los flex items se encogerán para llenar el contenedor de acuerdo a su número <code>flex-shrink</code> , cuando el tamaño por defecto de los flex items sea mayor al de su contenedor flex container.</p> + +<pre class="brush:css no-line-numbers">flex-shrink: 2; +flex-shrink: 0.6; + +/* Valores globales */ +flex-shrink: inherit; +flex-shrink: initial; +flex-shrink: unset; +</pre> + +<div class="hidden" id="flex-shrink"> +<pre class="brush: html"><div class="grid"> + <div class="row"> + <div class="cell">flex-shrink: + <div class="container"> + <div class="item small"><strong>0.5</strong> <p><small>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed at purus vitae ipsum hendrerit vulputate quis vitae risus.</small></p></div> + <div class="item mid"><strong>1</strong> <p><small>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed at purus vitae ipsum hendrerit vulputate quis vitae risus.</small></p></div> + <div class="item large"><strong>3</strong> <p><small>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed at purus vitae ipsum hendrerit vulputate quis vitae risus.</small></p></div> + </div> + </div> + </div> +</div></pre> + +<pre class="brush: css">html,body { + height: 100%; + box-sizing: border-box; + background: #EEE; +} + +.grid { + width: 100%; + height: 100%; + display: flex; + font: 1em monospace; +} + +.row { + display: flex; + flex: 1 auto; + flex-direction: row; + flex-wrap: wrap; +} + +.cell { + margin: .5em; + padding: .5em; + background-color: #FFF; + overflow: hidden; + text-align: left; + flex: 1; +} + +.note { + background: #fff3d4; + padding: 1em; + margin: .5em; + font: .8em sans-serif; + text-align: left; + flex: 1; + white-space: nowrap; +} + +.container { + background: #E4F0F5; + margin-top: .5em; + + display: flex; +} + +.item { + border: 1px solid black; + padding: 1em; +} + +.small { flex-shrink: 0.5; } +.mid { flex-shrink: 1; } +.large { flex-shrink: 3; }</pre> +</div> + +<div>{{EmbedLiveSample("flex-shrink", "100%", 280, "", "", "example-outcome-frame")}}</div> + +<p>{{cssinfo}}</p> + +<p> </p> + +<h2 id="Sintaxis">Sintaxis</h2> + +<p>La propiedad <code>flex-shrink</code> se especifica como un único <code><a href="#<number>"><número></a></code>.</p> + +<h3 id="Valores">Valores</h3> + +<dl> + <dt><a id="number" name="number"><code><número</code>></a></dt> + <dd>Véase{{cssxref("<number>")}}. Los valores negativos no son válidos</dd> +</dl> + +<h3 id="Sintaxi_formal">Sintaxi formal</h3> + +<pre class="syntaxbox">{{csssyntax}} +</pre> + +<h2 id="Ejemplo">Ejemplo</h2> + +<h3 id="HTML">HTML</h3> + +<div id="Live_Sample"> +<pre class="brush: html"><p>El ancho del contenido es de 500px; el flex-basis de los flex items es 120px.</p> +<p>A, B, C tiene flex-shrink:1. D y E tienen flex-shrink:2</p> +<p>El ancho de D y E es menor al de los otros.</p> +<div id="content"> + <div class="box" style="background-color:red;">A</div> + <div class="box" style="background-color:lightblue;">B</div> + <div class="box" style="background-color:yellow;">C</div> + <div class="box1" style="background-color:brown;">D</div> + <div class="box1" style="background-color:lightgreen;">E</div> +</div> +</pre> + +<h3 id="CSS">CSS</h3> + +<pre class="brush: css">#content { + display: flex; + width: 500px; +} + +#content div { + flex-basis: 120px; + border: 3px solid rgba(0,0,0,.2); +} + +.box { + flex-shrink: 1; +} + +.box1 { + flex-shrink: 2; +} +</pre> +</div> + +<h3 id="Result">Result</h3> + +<p>{{ EmbedLiveSample('Example', '500px', '300px', '', 'Web/CSS/flex-shrink') }}</p> + +<h2 id="Especificaciones">Especificaciones</h2> + +<table class="standard-table"> + <thead> + <tr> + <th>Especificación</th> + <th>Estado</th> + <th>Comentarios</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{ SpecName('CSS3 Flexbox', '#flex-shrink', 'flex-shrink') }}</td> + <td>{{ Spec2('CSS3 Flexbox') }}</td> + <td>Definición inicial</td> + </tr> + </tbody> +</table> + +<h2 id="Compatibilidad_con_navegadores">Compatibilidad con navegadores</h2> + + + +<p>{{Compat("css.properties.flex-shrink")}}</p> + +<h2 id="Vea_también">Vea también</h2> + +<ul> + <li>CSS Flexbox Guide: <em><a href="/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout/Basic_Concepts_of_Flexbox">Basic Concepts of Flexbox</a></em></li> + <li>CSS Flexbox Guide: <em><a href="/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout/Controlling_Ratios_of_Flex_Items_Along_the_Main_Ax">Controlling Ratios of flex items along the main axis</a></em></li> +</ul> + +<p><nobr></nobr></p> |