Foros del Web » Creando para Internet » CSS »

[SOLUCIONADO] Como alinear formuluario?

Estas en el tema de Como alinear formuluario? en el foro de CSS en Foros del Web. Hola A todos, necesito alinear un fomulario, Email y Nombre y los imput que queden alineados iguales ya que Email es mas corta que Nombre.... ...
  #1 (permalink)  
Antiguo 21/09/2015, 13:24
Avatar de fedefrankk  
Fecha de Ingreso: agosto-2007
Mensajes: 871
Antigüedad: 16 años, 8 meses
Puntos: 7
Pregunta Como alinear formuluario?

Hola A todos, necesito alinear un fomulario, Email y Nombre y los imput que queden alineados iguales ya que Email es mas corta que Nombre....

dejo codigo:

</head>
Código CSS:
Ver original
  1. <style>
  2. input#email{
  3.     margin:20px; /* BAJA DE ARRIABA HACIA ABAJO 20PX */
  4.     width:300px; /* LARGO DEL INPUT*/
  5.     height:30PX; /* ALTURA DEL INPUT*/
  6.     padding-left:10px; /*SEPARA EL TEXTO 10PX DENTRO DEL INPUT */
  7.     outline-color:#6BBFF1; /* COLOR DEL BORDE DEL INPUT COMO SE VE AL CARGAR LA WEB */
  8.     border:1px solid #C9CBCA;/* DEFINE EL COLOR DE LA LINEAS DEL INPUT*/
  9.     -webkit- border-radius: 4px; /* DEFINE LOS BORDES REDONDEADOS */
  10.     border-radius: 4px;
  11.     -webkit- box-shadow: 0px 0px 4px #B6B6B6; /* DEFINE SOMBRA */
  12.     box-shadow:0px 0px 4px #B6B6B6;
  13.     -webkit-transition: width .5s;
  14.     transition: width .5s;
  15.     }
  16.  
  17. input#email:focus{
  18.     width:350px; /* ALARGA EL INPUT A 350PX CON EL FOCUS */
  19.     border:1px solid #C9CBCA;/* DEFINE EL COLOR DE LA LINEAS DEL INPUT*/
  20.     }
  21. /***************************************/
  22. input#text{
  23.     margin:20px; /* BAJA DE ARRIABA HACIA ABAJO 20PX */
  24.     width:300px; /* LARGO DEL INPUT*/
  25.     height:30PX; /* ALTURA DEL INPUT*/
  26.     padding-left:10px; /*SEPARA EL TEXTO 10PX DENTRO DEL INPUT */
  27.     outline-color:#6BBFF1; /* COLOR DEL BORDE DEL INPUT COMO SE VE AL CARGAR LA WEB */
  28.     border:1px solid #C9CBCA;/* DEFINE EL COLOR DE LA LINEAS DEL INPUT*/
  29.     -webkit- border-radius: 4px; /* DEFINE LOS BORDES REDONDEADOS */
  30.     border-radius: 4px;
  31.     -webkit- box-shadow: 0px 0px 4px #B6B6B6; /* DEFINE SOMBRA */
  32.     box-shadow:0px 0px 4px #B6B6B6;
  33.     -webkit-transition: width .5s;
  34.     transition: width .5s;
  35.     }
  36.  
  37. input#text:focus{
  38.     width:350px; /* ALARGA EL INPUT A 350PX CON EL FOCUS */
  39.     border:1px solid #C9CBCA;/* DEFINE EL COLOR DE LA LINEAS DEL INPUT*/
  40.     }
  41.  
  42. input#boton{ padding:5px 50px; cursor:pointer;
  43. color:#FFFFFF;
  44. font-size:1em;
  45. background-color:#5DADE2;
  46.     -webkit-transition:background-color .25s;
  47.     transition:background-color .25s;
  48. border: 0px;
  49. -webkit- border-radius: 5px; /* DEFINE LOS BORDES REDONDEADOS */
  50. border-radius: 5px;
  51. -webkit- box-shadow: 0px 4px 0px #4AA4DF; /* DEFINE SOMBRA */
  52. box-shadow:0px 4px 0px #4AA4DF;
  53.  
  54. }
  55. input#boton:hover{
  56.     background-color:#7ABBE7;
  57.    
  58. }
  59.  
  60.  
  61.  
  62. </style>



Código HTML:
Ver original
  1. <form action="#" method="post" />
  2. <label for="email">Email:</label>
  3. <input type="email"  id="email" name="email" placeholder="escribe tu email">
  4. <br>
  5. <label for="text">Contraseña:</label>
  6. <input type="text"  id="text" name="text" placeholder="tu contraseña">
  7. <br>
  8. <input type="submit" value="enviar" id="boton">
  9. </form>
  10. </div>
  11. </body>
  12. </html>

Desde ya muchas gracias, espero que se entienda
saludos a todos.!
Fed
  #2 (permalink)  
Antiguo 21/09/2015, 14:38
Avatar de AngelKrak  
Fecha de Ingreso: noviembre-2014
Mensajes: 917
Antigüedad: 9 años, 5 meses
Puntos: 91
Respuesta: Como alinear formuluario?

Eso lo puedes hacer con un Display al Label ;)
Código CSS:
Ver original
  1. label {
  2.   display: inline-block;
  3.   width: 70px;
  4. }

Demo:
http://codepen.io/AngelKrak/pen/XmKZvb
  #3 (permalink)  
Antiguo 21/09/2015, 15:37
Avatar de fedefrankk  
Fecha de Ingreso: agosto-2007
Mensajes: 871
Antigüedad: 16 años, 8 meses
Puntos: 7
Respuesta: Como alinear formuluario?

Hola.! Espectacular.!!! Que sencillo que lo hacen y como me cuesta.!!!!

Saludos y gracias por tu tiempo.
fede

Etiquetas: alinear, background, color, html, todo, width
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 02:21.