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

Руководство по HTML

Полный список HTML-тегов

HTML: атрибут height <input>

Атрибут height определяет высоту элемента <input>, атрибут height доступен только для <input type="image">.

 HTML <input> тег

Онлайн пример

Определите изображение как кнопку submit, имеющую атрибуты height и width размером 50 пикселей:

<!DOCTYPE html>
<html>
<head>
<title>HTML: атрибут height <input> - Основной учебник сети (oldtoolbag.com)</title>
<body>
<form action="action_page.php">
  Имя: <input type="text" name="fname"><br>
  Фамилия: <input type="text" name="lname"><br>
  <input type="image" src="img_submit.gif" alt="Submit" width="50" height="50">
</form>
</body>
</html>
Проверьте, посмотрите ›‹

Совместимость с браузерами

IEFirefoxOperaChromeSafari

Все основные браузеры поддерживают атрибут height.

Определение и использование

Атрибут height определяет высоту элемента <input>.

Внимание:Атрибут height применяется только к <input type="image">.

Совет:Always specify both the height and width attributes of the image simultaneously. 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).

Различия между HTML 4.01 и HTML5

Атрибут height является новым атрибутом тега <input> в HTML5.

Синтаксис

<input height="пиксели">

Значение атрибута

ЗначениеОписание
пикселиВысота в пикселях (например, height="100").
 HTML <input> тег