background-repeat

important noteImportante:

Esta documentación es preliminar y es susceptible de cambio.

Establece cómo se coloca en mosaico la propiedad background-image del objeto.

Sintaxis

{ background-repeat: sRepeat }

Valores posibles

sRepeat

Cadena que especifica uno de los valores siguientes:

repeat

Valor predeterminado. La imagen se repite horizontal y verticalmente.

no-repeat

La imagen no se repite.

repeat-x

La imagen se repite horizontalmente.

repeat-y

La imagen se repite verticalmente.

Esta propiedad tiene el valor predeterminado repeat . No se hereda.

Observaciones

Los valores repeat-x y repeat-y hacen que la imagen se repita horizontal y verticalmente, respectivamente, y que se cree por tanto una banda de imágenes de un lado a otro.

Esta propiedad se puede establecer con otras propiedades de fondo mediante la propiedad compuesta background .

Ejemplos

En el siguiente ejemplo se usa la propiedad background-repeat para especificar si la imagen de fondo se coloca en mosaico. Se utiliza una llamada a una hoja de estilo incrustada (global) para colocar en mosaico la imagen:

<style>
    .style1 {background-image: url(sphere.jpg);
        background-repeat: repeat}
    .style2 {background-image: url(sphere.jpeg);
        background-repeat: no-repeat; }
</style>
</head>
<body>
<span onmouseover="this.className='style1'"
      onmouseout="this.className='style2'"
      onclick="this.className=''">
. . . 
</span>  

Información sobre estándares

Esta propiedad se define en la especificación Cascading Style Sheets (CSS), Level 1 (CSS1) (Hojas de estilos en cascada (CSS), nivel 1 (CSS1)) Ee371237.xtlink_newWindow(es-es,Expression.40).png.

Aplicable a

a, address, b, big, blockquote, body, button, caption, center, cite, code, col, colgroup, custom, dd, defaults, dfn, div, dl, dt, em, fieldset, form, hn, html, i, img, input type=button, input type=checkbox, input type=file, input type=image, input type=password, input type=radio, input type=reset, input type=submit, input type=text, li, ol, p, s, span, sub, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, var, xmp

Vea también

Conceptos

background
background-image

Copyright © 2011 de Microsoft Corporation. Reservados todos los derechos.