HTML size property
Example
The two input fields in the following HTML form are 35 characters and 4 characters wide, respectively:
Try it »
Browser support





All major browsers support the size property.
Definition and Usage
The size attribute specifies the visible width of the element, measured in number of characters.
**Note:** The size attribute applies to 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.
Differences between HTML 4.01 and HTML5
none.
Syntax
Attribute values
| Value | Description |
|---|---|
| number | Specifies the width, in characters, of the element. Default value is 20. |
HTML tag