Attributes · size
Which attributes affect size?
Use size for visible dimensions, maxlength for input length and CSS for layout.
| Attribute | What it does | Docs |
|---|---|---|
size | A positive integer: the approximate visible character width of a supported input, or the number of visible rows in a select. | MDN |
maxlength | Limits the length of a supported input's value; size controls its visible width instead. | MDN |
multiple | Allows multiple selections and displays a select as a listbox, including when size is 1. | MDN |
width (CSS) | CSS width overrides the input width suggested by size and offers more control over layout. | MDN |




