Ver Mensaje Individual
  #7 (permalink)  
Antiguo 22/10/2010, 17:31
Avatar de dargorg
dargorg
 
Fecha de Ingreso: octubre-2010
Ubicación: Castellón (España)
Mensajes: 188
Antigüedad: 13 años, 6 meses
Puntos: 9
Respuesta: Ayuda con fondo..

Perdona, se me escapó una cosilla. Elimina el position: relative del body en el CSS y ya te funcionará.

Un saludo,



Código:
<html>
	<head>
		<title>Centrando un div por CSS</title>
		
		<style type="text/css">
			body
			{
				background: #000;
				font: normal 12px Arial, Helvetica, sans-serif;
			}
			
			#contenedor
			{
				background: #fff;   /* color blanco de fondo */
				border: 2px solid #ccc;   /* borde gris */
				height: 400px;
				left: 50%;
				margin: -200px 0 0 -480px;
				position: absolute;
				top: 50%;
				width: 960px;
			}
		</style>
	</head>
	<body>	
		<div id="contenedor">contenido de la web</div>
	</body>
</html>