Ver Mensaje Individual
  #5 (permalink)  
Antiguo 10/12/2009, 18:42
Avatar de deirdre
deirdre
 
Fecha de Ingreso: mayo-2009
Mensajes: 690
Antigüedad: 15 años
Puntos: 45
Respuesta: Agrandar imagen de background segun resolucion usuario

Hola jonysi_d

No es necesario usar javascript para esto. Es suficiente con css.

Prueba esta aproximación y luego la adaptas a tu diseño:

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>Fondo de imagen elastica</title>
<style type="text/css">
* {
	margin: 0;
	padding: 0;
	outline: 0;
}
html, body {
	width: 100%;
	height: 100%;
}
#contenedor {
	width: 100%;
	height: 100%;
	position: relative;
}
#contenido {
	position: relative;
	z-index: 2;
}
.fondo {
	width: 100%;
	height: 100%;
	position: absolute;
	z-index: 1;
}
</style>

</head>

<body>
<!-- colocar una imagen de fondo de página totalmente elástica: siempre ocupará el 100% del ancho y del alto de la pantalla -->
<!-- cuidado al usar este sistema porque puede deformar la imagen y sus proporciones -->
<!-- si se hace un "resize" del navegador se verá que la imagen se adpata al tamaño que adquiera el browser -->
<div id="contenedor">
		<img class="fondo" alt="" src="http://farm3.static.flickr.com/2409/1619616706_7ce674a13f_o.jpg" />
		<div id="contenido">
		<p>A partir de aquí el resto del contenido de mi página</p>
		</div>
</div>

</body>

</html> 
Haz un copy-paste en un html limpio y lo pruebas.

Bye