Easy Tutorial
❮ Att Global Lang Tag Meta ❯

HTML <ol> compact Attribute

HTML <ol> Tag

Example

Using the compact attribute in an ordered HTML list:


Browser Support

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


Definition and Usage

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

The compact attribute is a boolean attribute.

The compact attribute specifies that the list should be displayed in a smaller size than normal, by reducing the line spacing and list indentation.


Compatibility Notes

In HTML 4.01, the compact attribute of <ol> is deprecated. Use CSS instead.

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

CSS Example: Reducing Line Height in Lists

In our CSS tutorial, you can find more details about the line-height property.


Differences Between HTML and XHTML

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


Syntax


❮ Att Global Lang Tag Meta ❯