HTML compact attribute

Updated: 10/11/2017 by Computer Hope

The HTML compact attribute is utilized with the <ol>, <ul>, and <dir> HTML tags to reduce the size of a list on a web page. Using the "compact" attribute with the HTML tag reduces the indentation of each line in the list and the space between lines in the list, to conserve space on the web page.

<ul compact>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>

The example above shows how the compact attribute would be used with the <ul> tag.

The compact attribute is a deprecated attribute and no longer supported by the major Internet browsers. It is also not supported in HTML5. Instead, you can use CSS to change line indentation and spacing between lines in a list.

HTML, Internet terms, Web design terms