English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The input height attribute specifies the height of the <input> element, the height attribute is only applicable to <input type="image">.
Define the image as a submit button with height and width attributes of size50 pixels:
<!DOCTYPE html> <html> <head> <title>HTML:<input> height 属性 - 基础教程网(oldtoolbag.com)</title> <body> <form action="action_page.php"> 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="50" height="50"> </form> </body> </html>Test it out ‹/›
IEFirefoxOperaChromeSafari
All major browsers support the height attribute.
The height attribute specifies the height of the <input> element.
Note:The height attribute only applies to <input type="image">.
Tip:Always specify both the height and width attributes of the image. If height and width are set, the space required for the image is reserved when the page is loaded. However, if these attributes are not set, the browser will not know the size of the image and will not be able to reserve appropriate space for it. The effect is that the page layout will change during loading (when the image is loading).
The height attribute is a difference5 as a new attribute of the <input> tag.
<input height="pixels">
Value | Description |
---|---|
pixels | Height in pixels (for example height="100"). |