A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.geeksforgeeks.org/html/html-input-height-attribute/ below:

HTML <input> height Attribute - GeeksforGeeks

HTML <input> height Attribute

Last Updated : 11 Jul, 2025

The HTML <input> element's height attribute sets the height of the input field in pixels. It only applies to image inputs (<input type="image">). For other input types, use CSS to control the height instead.

Syntax
<input height="pixels"> 
Attribute Values

It contains the value i.e pixels which specify the height of the input Element.

Example: In this example, we display an image input element with a specified height and width using the height attribute. The image is aligned centrally on the page.

html
<!DOCTYPE html>
<html>

<head>
    <title>
        HTML Input Image height Attribute
    </title>
</head>

<body style="text-align:center;">

    <h1 style="color:green;">
        GeeksForGeeks
    </h1>

    <h2>HTML Input image Height Attribute</h2>
    <input id="myImage" type="image" 
           src=
"https://media.geeksforgeeks.org/wp-content/uploads/gfg-40.png" alt="Submit"
           width="70" height="96" />

</body>

</html>

Output:

Supported Browsers

The browser supported by HTML <input> height Attribute are listed below:



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4