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

在线工具

参考手册

: <progress>-Tag

HTML: <input> size-Eigenschaft

 HTML <input> Tag

input size-Eigenschaft legt die sichtbare Breite des <input>-Elements (in Zeichen) fest, die size-Eigenschaft gilt für die folgenden input-Typen: text, search, tel, url, email und password.

Online-Beispiel11eine HTML-Formular, das zwei Eingabefelder enthält, deren Breite sich wie folgt verteilen:6und

Beispiel
<!DOCTYPE html>
<html>
<head> - <title>HTML: <input> size-Eigenschaft3codebox.com)</title>
<body>
<form action="action_page.php">
  Handynummer: <input type="text" name="email" size="11><br>
  Postleitzahlennummer <input type="text" name="code" maxlength="6" size="6><br>
  <input type="submit" value="Submit">
</form>
</html>
Test it out ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

All major browsers support the size attribute.

Definition and Usage

The size attribute specifies the visible width of the <input> element (in characters).

Note:The size attribute applies to the following input types: text, search, tel, url, email, and password.

Tip:To specify the maximum number of allowed characters in the <input> element, use maxlength Attribute.

HTML 4.01 and HTML5Differences between

None.

Syntax

<input size="number">

Attribute Value

ValueDescription
numberSpecify the width of the <input> element in terms of characters. The default value is 20.
 HTML <input> Tag