Tutorials References Exercises Videos Menu
Create Website Get Certified Upgrade

HTML <input> height Attribute

❮ HTML <input> tag

Example

Define an image as the submit button, with height and width attributes:

<form action="/action_page.php">
  <label for="fname">First name:</label>
  <input type="text" id="fname" name="fname"><br><br>
  <label for="lname">Last name:</label>
  <input type="text" id="lname" name="lname"><br><br>
  <input type="image" src="img_submit.gif" alt="Submit" width="48" height="48">
</form>
Try it Yourself »

Definition and Usage

The height attribute specifies the height of the <input> element.

Note: The height attribute is used only with <input type="image">.

Tip: Always specify both the height and width attributes for images. If height and width are set, the space required for the image is reserved when the page is loaded. However, without these attributes, the browser does not know the size of the image, and cannot reserve the appropriate space to it. The effect will be that the page layout will change during loading (while the images load).


Browser Support

The numbers in the table specify the first browser version that fully supports the attribute.

Attribute
height Yes Yes 16.0 Yes Yes

Syntax

<input height="pixels">

Attribute Values

Value Description
pixels The height in pixels (e.g. height="100")

❮ HTML <input> tag