The size
attribute defines the width of the <input>
and the height of the <select>
element. For an input
element, it defines the number of characters that the user agent allows the user to see when editing the value. For a select
element, it defines the number of options that should be shown to the user. This must be a valid non-negative integer greater than zero.
If no size
is specified, or an invalid value is specified, the input has no size declared, and the form control will be the default width based on the user agent. If CSS targets the element with properties impacting the width, CSS takes precedence.
The size
attribute has no impact on constraint validation.