Easy Tutorial
❮ Canvas Createlineargradient Att Button Formtarget ❯

HTML <input> height Attribute

HTML <input> Tag

Example

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


Browser Support

All major browsers support the height attribute.


Definition and Usage

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

Note: The height attribute is only applicable to <input type="image">.

Tip: It is a good practice to specify both height and width attributes for images. If these attributes are set, the required space is reserved when the page is loaded. Without these attributes, the browser cannot understand the image's dimensions and cannot reserve appropriate space for it. This can lead to layout changes as the page and images load.


Differences Between HTML 4.01 and HTML5

The height attribute is a new attribute for the <input> tag in HTML5.


Syntax

Attribute Values

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

❮ Canvas Createlineargradient Att Button Formtarget ❯