Latest web development tutorials

HTML input height property

HTML input Tag Reference HTML <input> tag

Examples

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

<form action="demo_form.html">
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"

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support height attributes.


Definition and Usage

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

Note: height attribute applies only to <input type = "image"> .

Tip: Specify the height and width attributes for the picture is a good habit. If you set these properties, when the page loads will need to reserve space image. And without these attributes, the browser will not be able to understand the dimensions of the image, it can not be reserved for a suitable space. It is when the page is loaded and pictures, page layout will change.


Differences between HTML 4.01 and HTML5

height attributes are new attributes in HTML5 <input> tag.


grammar

<input height="pixels">

Property Value

描述
pixels 以像素计的高度(比如 height="100")。


HTML input Tag Reference HTML <input> tag