Horje
How to edit HTML size Attribute in input

The input size attribute specifies the visible width, in characters, of an input field.

The default value for size is 20.

Note: The size attribute works with the following input types: text, search, tel, url, email, and password.


How is to look HTML size Attribute in input

Set a width for an input field:
index.html
Example: HTML
 <form>
  <label for="fname">First name:</label><br>
  <input type="text" id="fname" name="fname" size="50"><br>
  <label for="pin">PIN:</label><br>
  <input type="text" id="pin" name="pin" size="4">
</form> 

Output should be:

How is to look HTML size Attribute in input

Full Code Example of HTML size Attribute in input

The input size attribute The size attribute specifies the width (in characters) of an input field:
index.html
Example: HTML
<!DOCTYPE html>
<html>
<body>

<h1>The input size attribute</h1>

<p>The size attribute specifies the width (in characters) of an input field:</p>

<form action="/action_page.php">
  <label for="fname">First name:</label><br>
  <input type="text" id="fname" name="fname" size="50"><br>
  <label for="pin">PIN:</label><br>
  <input type="text" id="pin" name="pin" size="4"><br><br>
  <input type="submit" value="Submit">
</form>

</body>
</html>

Output should be:

Full Code Example of HTML size Attribute in input





Category:
Web Tutorial
Sub Category:
HTML Input Attributes
Uploaded by:
Admin


Read Article
https://develop.horje.com/learn/1434/reference