HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
For input elements, the size attribute specifies the visible width, in characters, of an <input> element."
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:
An HTML form with two input fields with a width of 35 and 4 characters:
<form
action="/action_page">
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>
A drop-down list with three visible options:
<select size="3">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="opel">Opel</option>
<option value="audi">Audi</option>
</select>
The size
attribute has the following browser support for each element:
Element | |||||
---|---|---|---|---|---|
input | 1.0 | 2.0 | 1.0 | 1.0 | 1.0 |
select | Yes | Yes | Yes | Yes | Yes |