La propiedad background resume las propiedades vistas anteriormente:
background: background-color
background-image
background-repeat
background-attachment
background-position
Se puede inicializar una o varias de las propiedades referentes al fondo (es indistinto el orden en que indicamos los valores)
Ejemplos:
p {
background: #cccccc url(fondo.jpg) repeat;
}
ul {
background url(fondo.png) no-repeat fixed #0000ff;
}
div {
background: top repeat-y scroll url(fondo.png);
}
Un ejemplo que inicializa esta propiedad con algunos valores en forma simultánea:
<!DOCTYPE html> <html> <head> <title>Problema</title> <link rel="StyleSheet" href="estilos.css" type="text/css"> </head> <body> </body> </html>
La hoja de estilo es:
body {
background: #ffffee url(fondo.jpg) repeat-x;
}
No es obligatorio inicializar todos los valores, tampoco el orden es importante.