Input type "number" won't resize

SaturnsEye picture SaturnsEye · Mar 28, 2014 · Viewed 108k times · Source

Why won't my input resize when I change the type to type="number" but it works with type="text"?

EXAMPLE

    Email: <input type="text" name="email" size="10"><br/>
  number: <input type="number" name="email" size="10">

Answer

Felix picture Felix · Mar 28, 2014

Seem like the input type number does not support size attribute or it's not compatible along browsers, you can set it through CSS instead:

input[type=number]{
    width: 80px;
} 

Updated Fiddle