Use of the compact attribute in an ordered HTML list:
The compact attribute is a boolean attribute.
When present, it specifies that the list should render smaller than normal, by reducing the space between lines and the indentation of the list.
Attribute | |||||
---|---|---|---|---|---|
compact | Not supported | Not supported | Not supported | Not supported | Not supported |
The compact attribute of <ol> is not supported in HTML5. Use CSS instead.
CSS syntax: <ol style="line-height: 80%">
CSS Example: Reduce line-height in a list
In our CSS tutorial you can find more details about the line-height property.
In XHTML, attribute minimization is forbidden, and the compact attribute must be defined as <ol compact="compact">.