Hola, nose cual es mi problema pero no puedo hacer que la imagen de mi pagina se centre verticalmente y horizontalmente.
Lo que quiero saber es ¿cual es mi problema?
porque la imagen no se queda en medio de la pagina.
Código:
<!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=iso-8859-1" />
<title>My page</title>
<style type="text/css">
* {
margin: 0;
padding: 0;
font-size: 100%;
}
body{
background-image:url(images/image1.jpg);
font-size: 16px;
font-size: 0.8em;
}
#centrador {
position: absolute;
top: 54%;
left: 0px;
width: 100%;
height: 0px;
}
#contenido {
position: relative;
top: -220px;
margin-left: auto;
margin-right: auto;
height: 400px;
width: 650px;
padding: 0px;
}
</style>
</head>
<body>
<div id="centrador">
<div id="contenido">
<div style="text-align:center">
<img src="http://www.forosdelweb.com/images/image2.jpg" alt="Haga clic aqui" width="520" height="400" />
</div>
</div>
</div>
</body>
</html>