Easy Tutorial
❮ Tag Template Att Textarea Readonly ❯

HTML <dir> compact Attribute

HTML <dir> Tag

Example

Using the compact attribute in a directory list:


Browser Support

Note: Currently, none of the major browsers support the compact attribute.


Definition and Usage

The compact attribute of <dir> is deprecated in HTML 4.01.

The compact attribute is a boolean attribute.

The compact attribute specifies that the list should be presented in a smaller, more compact form, achieved by reducing line spacing and indenting the list.


Compatibility Notes

The compact attribute of <dir> is deprecated in HTML 4.01. Use CSS instead.

CSS syntax: <dir 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, so the compact attribute must be defined as: <dir compact="compact">.


Syntax


❮ Tag Template Att Textarea Readonly ❯