Esta traducción está incompleta. Por favor, ayuda a traducir este artículo del inglés.
Resumen
background-repeat especifica si la imagen es repetida (mosaïco) y de que manera.
valor inicial: repetición (repeat)- Se aplica a: todos los elementos
herencia: no- Percentages: N/A
- Medio:
visual valor calculada: como se especificó
Sintaxis
background-repeat: repeat | repeat-x | repeat-y | no-repeat | inherit
Valores
- repeat
- la imagen es repetida horizontal y verticalmente
- repeat-x
- repetición únicamente en horizontal.
- repeat-y
- repetición únicamente en vertical.
- no-repeat
- no hay repetición: una sola copia es expuesta.
Ejemplos
HTML
<ol>
<li>no-repeat
<div class="one"> </div>
</li>
<li>repeat
<div class="two"> </div>
</li>
<li>repeat-x
<div class="three"> </div>
</li>
<li>repeat-y
<div class="four"> </div>
</li>
<li>repeat-x, repeat-y (multiple images)
<div class="five"> </div>
</li>
</ol>
CSS
/* Shared for all DIVS in example */
li {margin-bottom: 12px;}
div {
background-image: url(https://mdn.mozillademos.org/files/12005/starsolid.gif);
width: 144px;
height: 84px;
}
/* background repeat CSS */
.one {
background-repeat: no-repeat;
}
.two {
background-repeat: repeat;
}
.three {
background-repeat: repeat-x;
}
.four {
background-repeat: repeat-y;
}
/* Multiple images */
.five {
background-image: url(https://mdn.mozillademos.org/files/12005/starsolid.gif),
url(https://developer.cdn.mozilla.net/media/redesign/img/favicon32.png);
background-repeat: repeat-x,
repeat-y;
height: 144px;
}
Result
In this example, each list item is matched with a different value of background-repeat.
Especificaciones
Compatibilidad
| Navegador | Versión mínima |
|---|---|
| Internet Explorer | 4 |
| Firefox | 1 |
| Netscape | 4 |
| Opera | 3.5 |
Ver también
background, background-attachment, background-color, background-image, background-position, background-repeat
Categorías
Interwiki languages