HTML <dir> compact Attribute
Use of the compact attribute in a directory list:
Try it yourself »
Note: The compact attribute is not supported by any of the major browsers.
Definition and Usage
The <dir> tag is not supported in HTML5. Use CSS instead.
The compact attribute of <dir> is deprecated in HTML 4.01.
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.
The compact attribute of <dir> is deprecated in HTML 4.01. Use CSS instead.
CSS syntax: <dir style="line-height: 80%">
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 <dir compact="compact">.
HTML <dir> tag
Thank You For Helping Us!
Your message has been sent to W3Schools.