HTML input size Attribute
HTML <input> tag
Definition and Usage
The size attribute specifies the length (in number of characters) of "text"
or "password" fields.
Compatibility Notes
Since this is a purely visual design attribute, it is recommended to use CSS
styles instead.
CSS syntax: <input style="width:100px" />
In our CSS tutorial you can find more details about the
width property.
Syntax
<input size="char_length" />
|
Syntax Example
Attribute Values
Value |
Description |
char_length |
Specifies the length of the input element.
The length is specified in number of characters. |
Browser Support

The attribute is supported in all major browsers.
Example
<form action="">
<input type="text" name="demo" size="10" />
</form>
|
Try-It-Yourself Demos
input size
attribute example
How use the size attribute with the input type="text".
In CSS:
input width example
Set the width of an input element.
HTML <input> tag
 |

|
|
See why there are 20,000+ Ektron integrations worldwide.
Request an INSTANT DEMO or download a FREE TRIAL today. |
|
|
|