W3Schools.com

HTML5 <input> height Attribute

HTML5 input Tag Reference HTML5 <input> tag

Example

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

<form action="demo_form.asp">
First name: <input type="text" name="fname" /><br />
Last name: <input type="text" name="lname" /><br />
<input type="image" src="img_submit.gif" alt="Submit" width="48" height="48"/>
</form>

Try it yourself »

Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The height attribute is supported in all major browsers.


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).


Differences Between HTML 4.01 and HTML5

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


Syntax

<input height="pixels" />

Attribute Values

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


HTML5 input Tag Reference HTML5 <input> tag
WEB HOSTING
Best Web Hosting
PHP MySQL Hosting
Best Hosting Coupons
UK Reseller Hosting
Cloud Hosting
Top Web Hosting
$3.98 Unlimited Hosting
Premium Website Design
WEB BUILDING
XML Editor - Free Trial!
FREE Website BUILDER
Best Website Templates Top CSS Templates
CREATE HTML Websites
EASY WEBSITE BUILDER
W3SCHOOLS EXAMS
Get Certified in:
HTML, CSS, JavaScript, XML, PHP, and ASP
W3SCHOOLS BOOKS
New Books:
HTML, CSS
JavaScript, and Ajax
STATISTICS
Browser Statistics
Browser OS
Browser Display
SHARE THIS PAGE