Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML dir compact Attribute

HTML The compact attribute

HTML dir Tag Reference HTML

tag

Example

Using the compact attribute in a directory list:

 

  • html
  •  

  • xhtml
  •  

  • css
  • Try it »


    Browser support

    Internet ExplorerFirefoxOperaGoogle ChromeSafari

    Note: Currently no major browser supports the compact attribute.


    Definition and Usage

    The tag is no longer supported in HTML5. Please use CSS instead. The compact attribute is deprecated in HTML 4.01.

    The compact attribute is a boolean attribute.

    The compact attribute specifies that the list should be rendered more compactly than normal, by reducing line spacing and indenting the list.


    Compatibility notes

    The compact attribute is deprecated in HTML 4.01. Please use CSS instead.

    CSS syntax:

    CSS example: reducing the line height in a list

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


    Differences between HTML and XHTML

    In XHTML, attribute minimization is not allowed, and the compact attribute must be defined as:

    .


    Syntax


    HTML dir Tag Reference HTML

    tag