English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
input height 属性规定 <input> 元素的高度,height 属性只适用于 <input type="image">。
定义图片为submit按钮,具有 height 和 width 属性大小为50像素:
!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>Prueba aquí ‹/›
IEFirefoxOperaChromeSafari
Todos los navegadores principales admiten la propiedad height.
La propiedad height especifica la altura del elemento <input>.
Nota:La propiedad height solo se aplica a <input type="image">.
Consejo:Siempre se debe especificar tanto el atributo height como el width de la imagen. Si se especifican height y width, se reserva el espacio necesario para la imagen al cargar la página. Sin embargo, si no se especifican estos atributos, el navegador no sabrá el tamaño de la imagen y no podrá reservar el espacio adecuado. El efecto es que el diseño de la página se cambiará durante el proceso de carga (cuando se carga la imagen).
La propiedad height es un atributo de HTML5 Es un nuevo atributo del etiqueta <input>.
<input height="píxeles">
Valor | Descripción |
---|---|
píxeles | Altura en píxeles (por ejemplo height="100")。 |