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

HTML ol compact Attribute

HTML
    The compact attribute

HTML ol Tag Reference HTML

    tag

    Example

    Using the compact attribute in an ordered HTML list:

    1. Coffee
    2. Tea
    3. Milk

    Try it »


    Browser support

    Internet ExplorerFirefoxOperaGoogle ChromeSafari

    **Note:** Almost no major browser supports the compact attribute.


    Definition and Usage

    HTML5 does not support

      the compact attribute. Use CSS instead.

      In HTML 4.01,

        The compact attribute of the element is deprecated.

        The compact attribute is a boolean attribute.

        The compact attribute specifies that the list should be displayed in a more compact style than normal, by reducing line spacing and list indentation.


        Compatibility notes

        In HTML 4.01,

          The compact attribute of the element is deprecated. Use CSS instead.

          CSS syntax:

            CSS example: reducing the line height in a list

            In our CSS tutorial, you can find more details about The line-height property details.


            Differences between HTML and XHTML

            In XHTML, attribute minimization is forbidden, so the compact attribute must be defined as

              .


              Syntax


                HTML ol Tag Reference HTML

                  tag