Latest web development tutorials

HTML ol compact property

HTML ol tag Reference Manual HTML <ol> tag

Examples

Use compact attribute in an ordered HTML list:

<ol compact>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>

try it"

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

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


Definition and Usage

HTML5 does not support the <ol> compact property. Use CSS instead.

In HTML 4.01, <ol> The compact attribute obsolete .

compact attribute is a Boolean attribute.

compact attribute specifies the list of display should be smaller than normal, by reducing the line spacing and indentation of the list.


Compatibility Notes

In HTML 4.01, <ol> The compact attribute obsolete, please use CSS instead.

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

CSS Example: to narrow the list row height

In our CSS tutorial you can find more information about the line-height attribute details.


Differences between HTML and XHTML

In XHTML, prohibit attribute minimization, compact property must be defined as <ol compact = "compact">.


grammar

<ol compact>


HTML ol tag Reference Manual HTML <ol> tag