diff options
Diffstat (limited to 'files/es/web/css/background-attachment/index.html')
-rw-r--r-- | files/es/web/css/background-attachment/index.html | 133 |
1 files changed, 133 insertions, 0 deletions
diff --git a/files/es/web/css/background-attachment/index.html b/files/es/web/css/background-attachment/index.html new file mode 100644 index 0000000000..0075a07f88 --- /dev/null +++ b/files/es/web/css/background-attachment/index.html @@ -0,0 +1,133 @@ +--- +title: background-attachment +slug: Web/CSS/background-attachment +tags: + - CSS +translation_of: Web/CSS/background-attachment +--- +<p>{{CSSRef}}</p> + +<h3 id="Resumen" name="Resumen">Resumen</h3> + +<p>La propiedad CSS <strong><code>background-attachment</code></strong> determina si la posición de la imagen de fondo será <strong>fija</strong> dentro de la pantalla o <strong>se desplazará</strong> con su bloque contenedor.</p> + +<ul> + <li>{{ Cssxref("initial", "Inicial") }}: desplazamiento (<em>scroll</em>)</li> + <li>Se aplica a: todos los elementos</li> + <li>{{ Cssxref("inheritance", "Herencia") }}: no</li> + <li>Porcentajes: N/A</li> + <li>Medio: {{ Cssxref("Media:Visual", "visual") }}</li> + <li>{{ Cssxref("computed value", "Valor calculada") }}: como se haya especificado</li> +</ul> + +<h3 id="Sintaxis" name="Sintaxis">Sintaxis</h3> + +<pre class="eval notranslate">background-attachment: scroll | fixed | inherit +</pre> + +<h3 id="Valores" name="Valores">Valores</h3> + +<dl> + <dt>scroll </dt> + <dd>Si <code>scroll</code> es especificado, la imagen de fondo se moverá dentro de la pantalla junto al bloque que la contiene.</dd> + <dt>fixed </dt> + <dd>Si <code>fixed</code> es especificado, la imagen de fondo estará fija en la pantalla y no se moverá con el bloque contenedor.</dd> +</dl> + +<h2 id="Ejemplos">Ejemplos</h2> + +<h3 id="Ejemplo_simple">Ejemplo simple</h3> + +<h4 id="CSS">CSS</h4> + +<pre class="brush:css; highlight:[3]; notranslate">p { + background-image: url("https://mdn.mozillademos.org/files/12057/starsolid.gif"); + background-attachment: fixed; +} +</pre> + +<h4 id="HTML">HTML</h4> + +<pre class="brush: html notranslate"><p> + There were doors all round the hall, but they were all locked; and when + Alice had been all the way down one side and up the other, trying every + door, she walked sadly down the middle, wondering how she was ever to + get out again. +</p></pre> + +<h4 id="Result">Result</h4> + +<p>{{EmbedLiveSample("Simple_example")}}</p> + +<h3 id="Soporta_múltiples_imagenes_de_fondo">Soporta múltiples imagenes de fondo</h3> + +<p>Esta propiedad soporta multiples imágenes de fondo. Puedes especificar un <code><attachment></code> diferente por cada imagen de fondo, separado por comas. Cada imagen es asociada con el correspondiente valor de <attachment>, especificado desde el primero hasta el último.</p> + +<h4 id="CSS_2">CSS</h4> + +<pre class="brush:css; highlight:[3]; notranslate">p { + background-image: url("https://mdn.mozillademos.org/files/12057/starsolid.gif"), url("https://mdn.mozillademos.org/files/12059/startransparent.gif"); + background-attachment: fixed, scroll; + background-repeat: no-repeat, repeat-y; +}</pre> + +<h4 id="HTML_2">HTML</h4> + +<pre class="brush: html notranslate"><p> + There were doors all round the hall, but they were all locked; and when + Alice had been all the way down one side and up the other, trying every + door, she walked sadly down the middle, wondering how she was ever to + get out again. + + Suddenly she came upon a little three-legged table, all made of solid + glass; there was nothing on it except a tiny golden key, and Alice's + first thought was that it might belong to one of the doors of the hall; + but, alas! either the locks were too large, or the key was too small, + but at any rate it would not open any of them. However, on the second + time round, she came upon a low curtain she had not noticed before, and + behind it was a little door about fifteen inches high: she tried the + little golden key in the lock, and to her great delight it fitted! +</p></pre> + +<h4 id="Resultado">Resultado</h4> + +<p>{{EmbedLiveSample("Multiple_background_image_support")}}</p> + +<h3 id="Especificaciones" name="Especificaciones">Especificaciones</h3> + +<ul> + <li><a class="external" href="http://www.w3.org/TR/CSS1#background-attachment">CSS 1</a></li> + <li><a class="external" href="http://www.w3.org/TR/CSS21/colors.html#propdef-background-attachment">CSS 2.1</a></li> + <li><a class="external" href="http://www.w3.org/TR/2005/WD-css3-background-20050216/#background-attachment">CSS 3</a></li> +</ul> + +<h3 id="Compatibilidad_de_navegadores" name="Compatibilidad_de_navegadores">Compatibilidad de navegadores</h3> + +<table class="standard-table"> + <tbody> + <tr> + <th>Navegador</th> + <th>Versión mínima</th> + </tr> + <tr> + <td>Internet Explorer</td> + <td>4</td> + </tr> + <tr> + <td>Firefox</td> + <td>1</td> + </tr> + <tr> + <td>Netscape</td> + <td>6</td> + </tr> + <tr> + <td>Opera</td> + <td>3.5</td> + </tr> + </tbody> +</table> + +<h3 id="Ver_tambi.C3.A9n" name="Ver_tambi.C3.A9n">Ver también</h3> + +<p>{{ Cssxref("background") }}, {{ Cssxref("background-attachment") }}, {{ Cssxref("background-color") }}, {{ Cssxref("background-image") }}, {{ Cssxref("background-position") }}, {{ Cssxref("background-repeat") }}</p> |