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

HTML Referenzhandbuch

HTML-Tag-Übersicht

HTML ol compact Attribut

Das compact-Attribut ist ein booleschesAttribut. Wenn es vorhanden ist, gibt es durch Verkleinern des Abstands zwischen den Zeilen und der Einzug der Liste an, dass die Liste kleiner dargestellt werden sollte als normal.

 HTML <ol> Tag

Online-Beispiel

Verwenden Sie das compact-Attribut in geordneten HTML-Listen:

<!DOCTYPE html>
<html>
<head>
<title>HTML: <ol> compact-Attribut - Grundlagen-Tutorial-Netz(oldtoolbag.com)</title>
</head>
<body>
<ol compact>
  <li>Kaffee</li>
  <li>Tee</li>
  <li>Milch</li>
</ol>
</body>
</html>
Testen Sie, sehen Sie ‹/›

Browserkompatibilität

IEFirefoxOperaChromeSafari

Note:Almost all mainstream browsers do not support the compact attribute.

Definition and Usage

HTML5 The <ol> compact attribute is not supported. Please use CSS instead.

In HTML 4.01 In this case, the compact attribute of <ol> is deprecated.

The compact attribute is a boolean attribute.

When present, it specifies that the list should be displayed smaller than normal by reducing the space between lines and the list's indentation.

Compatibility Notes

In HTML 4.01 In this case, the compact attribute of <ol> is deprecated, please use CSS instead.

CSS syntax: <ol style="line-height: 80%">

CSS Example: Reduce the line height in the list

You can find more about line-height attribute in detail.

Differences between HTML and XHTML

In XHTML, attribute shorthand is prohibited, and the compact attribute must be defined as <ol compact="compact">.

Syntax

<ol compact>
 HTML <ol> Tag