Ver Mensaje Individual
  #5 (permalink)  
Antiguo 27/09/2009, 16:15
Avatar de deirdre
deirdre
 
Fecha de Ingreso: mayo-2009
Mensajes: 690
Antigüedad: 14 años, 11 meses
Puntos: 45
Respuesta: Problema con scroll e imagen centrada

Hola lord_ocram

"Mejorando lo presente", a mí es que no termina de gustarme mucho tu código, así que te presento otro que cumple con lo que necesitas:

Código HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Centrado de foto independientemente de la resolución de pantalla</title>
<style type="text/css">
* {
	margin: 0;
	padding: 0;
	outline: 0;
}
html, body {
	background-color: #000;
	width: 100%;
	height: 100%;
	overflow: auto;
}
#caja_foto {
	position: absolute;
	width: 750px;
	height: 536px;
	margin-left: -375px;
	margin-top: -268px;
	left: 50%;
	top: 50%;
	background-image:url('fondo_index03.jpg');
	border: 1px solid #444;
}
</style>
</head>

<body>
	<div id="caja_foto"></div>
</body>

</html> 
Pruébalo y comenta algo.

Bye