0% found this document useful (0 votes)
4 views12 pages

HTML Size Attribute Explained

The HTML size attribute specifies the visible width of <input> elements in characters or the number of visible options in a <select> drop-down list. It can be used with <input> and <select> elements, setting the number of visible characters or options. The size attribute works for certain input types like text, search, tel, and specifies the maximum number of visible characters, while maxlength limits the total characters allowed.

Uploaded by

Fritz Cci
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views12 pages

HTML Size Attribute Explained

The HTML size attribute specifies the visible width of <input> elements in characters or the number of visible options in a <select> drop-down list. It can be used with <input> and <select> elements, setting the number of visible characters or options. The size attribute works for certain input types like text, search, tel, and specifies the maximum number of visible characters, while maxlength limits the total characters allowed.

Uploaded by

Fritz Cci
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

HTML SIZE ATTRIBUTE

Definition and usage


 For input elements, the
size attribute specifies
The visible width, in
characters of an <input>
element
 For select elements, the
Size attribute specifies
the number of visible
options in a drop-down
list.
The size attribute can be
used on the following
elements:
Elements Attribute
<input> Size
<select> size
Note: The size attribute
works with the following
input types: text, search,
tel, url, email and pass.
Tip: To specify the
maximum number of
characters allowed in the
<input> element, use the
maxlength attribute.

<input size=”number”>
Attribute Values
Values Description
Number Specifies the
width of an
<input> element, in
characters. Default value
is 20

You might also like