Ver Mensaje Individual
  #7 (permalink)  
Antiguo 08/04/2011, 15:12
Avatar de IsaBelM
IsaBelM
Colaborador
 
Fecha de Ingreso: junio-2008
Mensajes: 5.032
Antigüedad: 15 años, 10 meses
Puntos: 1012
Respuesta: Mostrar centrado un DIV aunque se salga de pantalla

continuo diciendo lo mismo; si le he entendido, el no quiere usar unidades relativas, por lo tanto ha de usar javascript.

aunque interesante el ejemplo, se puede obtener el mismo resultado usando la propiedad float. algo como esto
Cita:
<!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 content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Page</title>
<style type="text/css">
html, body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
overflow: hidden;
position: relative;
}
#contenedor {
width: 100%;
height: 80%;
}
#izquierdo {
float: left;
width: 20%;
height: 100%;
background-color: #00f;
}
#derecho {
float: right;
width: 20%;
height: 100%;
background-color: #ccc;
}
#marca_central {
float: left;
width: 60%;
height: 100%;
background-color: #000;
}
</style>
</head>

<body>
<div id="contenedor">
<div id="izquierdo">Lado izquierdo</div>
<div id="marca_central">Lado central</div>
<div id="derecho">Lado derecho</div>
</div>


</body>
</html>