You are here: Reference > HTML > attributes > size (input, isindex, ...)

size attribute (input, isindex, ...)

Browser support:
Specifies the width of a control, in characters.
The width is calculated by the average character widths. You can set the dimensions of the input field by the width and the height style properties.
JavaScript page for this attribute: size. You can find other example(s) there.

Possible values:

Integer that sets the width of the control, in characters. The default is 20.
Default: this attribute has no default value.

Example HTML code 1:

This example illustrates the use of the size attribute:
Input field with size=20:
<br />
<input id="myInput" type="text" size="20" />
<br /><br /><br />
Input field with size=30:
<br />
<input id="myInput" type="text" size="30" />
Did you find this example helpful? yes no

Supported by tags:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content