Ver Mensaje Individual
  #2 (permalink)  
Antiguo 30/07/2012, 10:51
Avatar de chabri
chabri
 
Fecha de Ingreso: septiembre-2009
Ubicación: Torremolinos
Mensajes: 227
Antigüedad: 14 años, 7 meses
Puntos: 17
Respuesta: Posición de un formulario dentro de la página

Aquí te lo dejo

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 http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Formulario</title>
<style type="text/css">
#contenedor {
#contenedor {
width: 300px;
height: 250px;
margin: auto;
width: 300px;
height: 250px;
position:absolute;
left:50%;
top:50%;
margin-left:-150px;
margin-top:-125px;
background-color:#333;

}
#contenedor-form{
position:absolute;
top:50%;
height:125px;
margin-top:-80px;
background-color:#ccc;
width:260px;
padding:20px;
}
input{
width:100%;
font-family:arial;
}
}
</style>
</head>
<body>
<div id="contenedor">
<div id="contenedor-form">
<FORM method="post" name="formulario" action="pagina.php">
Nombre:<input type="text" name="nombre" id="nombre"><br />
Apellido: <input type="text" name="Apellido" id="apellido"><br />
<input type="submit" value="Enviar">
<input type="reset"></FORM>
</div></div>
</body>

Lo que hice fue centrarlo vertical y horizontal con el "#contenedor" y despues centre con "#cotenendor-form" verticalmente.

Un saludo!