![]() |
Definition and Usage
For input elements, the
For select elements, the Applies to
The
Browser Support
The
|
Example:
HTML
<!DOCTYPE html>
<html>
<body>
<h1>The input size attribute</h1>
<form action="/action_page.php"> <label for="fname">First name:</label> <input type="text" id="fname" name="fname" size="50"><br><br> <label for="pin">PIN:</label> <input type="text" id="pin" name="pin" maxlength="4" size="4"><br><br> <input type="submit" value="Submit">
</form>
</body>
</html>
Example:
HTML
<!DOCTYPE html>
<html>
<body>
<h1>The select size attribute</h1>
<p>The size attribute specifies the number of visible options in a drop-down list:</p>
<form action="/action_page.php"> <label for="cars">Choose a car:</label> <select id="cars" name="cars" size="3"> <option value="volvo">Volvo</option> <option value="saab">Saab</option> <option value="opel">Opel</option> <option value="audi">Audi</option> </select> <br><br> <input type="submit" value="Submit">
</form>
</body>
</html>
html size attribute |
How to add An HTML form with two input fields with a width of 35 and 4 characters - HTML size Attribute | HTML Attribute |
How to add A drop-down list with three visible options - HTML size Attribute | HTML Attribute |
Type
: |
Develop |
Category
: |
Web Tutorial |
Sub Category
: |
HTML Attribute |
Uploaded by
: |
Admin |
Read Article https://horje.com/learn/1434/reference