Pregunta

I am having an issue with the height of the password field differing from that of the textfield above it even if I apply style="height:22px" directly to both elements.

Current HTML:

  <h2>Username 
    <label>
      <input name="email" type="text" id="email" style="height:22px" />
      </label>
  </h2>
  <h2>Password  
    <label>
      <input name="password" type="password" id="password"style="height:22px"  />
      </label>
  </h2>

Current CSS:

#logonForm input[type=text], #logonForm input[type=password] { 
    font-size:18px;
    border-radius:8px;
    padding-left:10px;
    height:22px;
    width:364px;
}

This renders (with or without the style attribute) as

screenshot

How do I make it render as the same height and why is this occurring?

¿Fue útil?

Solución

You might have to add explicit padding for ALL sides, not just padding-left:

#logonForm input[type=text], #logonForm input[type=password] { 
    font-size:18px;
    border-radius:8px;
    padding:0 0 0 10px;
    height:22px;
    width:364px;
}
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top