HTML
The compact attribute
-
tag
- Coffee
- Tea
- Milk
Example
Using the compact attribute in an ordered HTML list:
Try it »
Browser support





**Note:** Almost no major browser supports the compact attribute.
Definition and Usage
HTML5 does not support
-
the compact attribute. Use CSS instead.
In HTML 4.01,
-
The compact attribute of the element is deprecated.
The compact attribute is a boolean attribute.
The compact attribute specifies that the list should be displayed in a more compact style than normal, by reducing line spacing and list indentation.
Compatibility notes
In HTML 4.01,
-
The compact attribute of the element is deprecated. Use CSS instead.
CSS syntax:
CSS example: reducing the line height in a list
In our CSS tutorial, you can find more details about The line-height property details.
Differences between HTML and XHTML
In XHTML, attribute minimization is forbidden, so the compact attribute must be defined as
-
.
Syntax
HTML
-
tag