size Attributesize Attributesize is declared on the elements: input type="text", input type="password", input type="file", selectFor the input type="text",
input type="password" and
input type="file"
elements, the size attribute may be used to specify the width of the
text box, measured in average character widths.
This does not affect how many characters may be entered - use the
maxlength attribute for that
(but not for input type="file").
For the select element,
the size attribute may be used to specify the number of
option items which should
be visible at any one time. This is only applicable if the
select element is
rendered as a scrolled list; if the list is displayed in a different manner
(e.g. a drop-down list) it is not relevant. In some cases, however,
the rendering method is changed if the size attribute is
specified. For example, this is how my newly-downloaded
version of Firefox 3 displays select lists:
multiple nor size attributes are specified:select is rendered as a drop-down listmultiple is specified but not size:select is rendered as a scrolled list, with 20 items visible at any one timesize is specified but not multiple:select is rendered as a scrolled list, with the number of items visible at any one time
being the value of the size attribute.size and multiple attributes are specified:select is rendered as a scrolled list, with the number of items visible at any one time
being the value of the size attribute.This behaviour will vary between user agents, however.