Easy Tutorial
❮ Att A Target Canvas Createlineargradient ❯

HTML <input> size Attribute

HTML <input> Tag

Example

The following HTML form has two input fields with widths of 35 characters and 4 characters, respectively:


Browser Support

All major browsers support the size attribute.


Definition and Usage

The size attribute specifies the visible width of an <input> element in 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 an <input> element, use the maxlength attribute.


Differences Between HTML 4.01 and HTML5

None.


Syntax

Attribute Values

Value Description
number Specifies the width of the <input> element in characters. The default value is 20.

❮ Att A Target Canvas Createlineargradient ❯