Why won\'t my input resize when I change the type to type=\"number\"
but it works with type=\"text\"
?
EXAMPLE
Email: &l
Incorrect usage.
Input type number it's made to have selectable value via arrows up and down.
So basically you are looking for "width" CSS style.
Input text historically is formatted with monospaced font, so size it's also the width it takes.
Input number it's new and "size" property has no sense at all*. A typical usage:
<input type="number" name="quantity" min="1" max="5">
w3c docs
to fix, add a style:
<input type="number" name="email" style="width: 7em">
EDIT: if you want a range, you have to set type="range"
and not ="number"
EDIT2: *size is not an allowed value (so, no sense). Check out official W3C specifications
Note: The size attribute works with the following input types: text, search, tel, url, email, and password.
Tip: To specify the maximum number of characters allowed in the element, use the maxlength attribute.