HTML dir compact Attribute
HTML <dir> tag
Definition and Usage
The compact attribute specifies that the spacing between lines and
indentation of the list should be reduced.
Compatibility Notes
The compact attribute of the del element was deprecated in HTML 4.01
and is not supported in XHTML 1.0 Strict DTD.
Use CSS instead.
There is no CSS property that does the exact same thing that the compact
attribute was supposed to do. However, the line-height property could be a
suitable replacement.
CSS syntax: <dir style="line-height: 100%">
In our CSS tutorial you can find more details about the
line-height property.
Syntax
Attribute Values
Value |
Description |
compact |
Specifies a compact list. |
Browser Support
The attribute is deprecated, not supported by major browsers, and should be avoided.
Example
Source |
Output |
<dir compact="compact">
<li>Peter Griffin</li>
<li>Glenn Quagmire</li>
<li>Cleveland Brown</li>
</dir>
|
Peter Griffin
Glenn Quagmire
Cleveland Brown
|
Try-It-Yourself Demos
dir compact
attribute example
Make the directory list more compact using the dir compact attribute.
In CSS:
dir list line-height example
Make the directory list more compact using CSS.
HTML <dir> tag
|