size
Summary
This article outlines the HTML attribute "size", which allows the user to specify a width in characters of an <input> element.
Applies to | ? |
---|
Note: The size attribute works with the following input types: text, search, tel, url, email, and password.
Tip: To specify the maximum number of characters allowed in the <input> element, use the maxlength attribute.
Examples
<form action="demo_form.asp">
Email: <input type="text" name="email" size="35"><br>
PIN: <input type="text" name="pin" maxlength="4" size="4"><br>
<input type="submit" value="Submit">
</form>
Syntax
Standards information
- Document Object Model (DOM) Level 1 Specification, Section 2.5.5
- HTML 4.01 Specification, Section 15.2.2 (Deprecated)
See also
Related articles
Fonts
size
HTML
size
Text
size
Related pages
baseFont
font
Attributions
Microsoft Developer Network: [Windows Internet Explorer API reference Article]