The size attribute on an <input> tag defines the character width of the element.
Effectively, this is the number of characters that are visible.
A size attribute on an <input> element.
The textbox is 25 characters wide, i.e. 25 characters are visible.
<label for="firstname">First name</label><br/>
<input type="text" size="25"
name="firstname" value="Melanie" >
The size attribute defines the <input> element's width in terms of number of characters.
This size attribute only applies to these input types:
<input size="number">
Value | Description |
---|---|
number | The number of visible characters in the input element. |
Here is when size support started for each browser:
Chrome
|
1.0 | Sep 2008 |
Firefox
|
1.0 | Sep 2002 |
IE/Edge
|
1.0 | Aug 1995 |
Opera
|
1.0 | Jan 2006 |
Safari
|
1.0 | Jan 2003 |
Back to <input>