English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML 参考手册

HTML 标签大全

HTML: <input> height 属性

input height 属性规定 <input> 元素的高度,height 属性只适用于 <input type="image">。

 HTML <input> etiqueta

在线示例

定义图片为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í ‹/›

Compatibilidad del navegador

IEFirefoxOperaChromeSafari

Todos los navegadores principales admiten la propiedad height.

Definición y uso

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

HTML 4.01 con HTML5diferencias

La propiedad height es un atributo de HTML5 Es un nuevo atributo del etiqueta <input>.

Sintaxis

<input height="píxeles">

Valor del atributo

ValorDescripción
píxelesAltura en píxeles (por ejemplo height="100")。
 HTML <input> etiqueta