VOOZH about

URL: https://www.geeksforgeeks.org/html/html-ol-compact-attribute/

⇱ HTML <ol> compact Attribute - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

HTML <ol> compact Attribute

Last Updated : 22 May, 2026

The HTML <ol> compact attribute was used to display an ordered list in a more compact form with reduced spacing between items. 

  • Used with the <ol> tag for compact list display.
  • It reduced the space between list items.

Syntax:

 <ol compact>

Note: The HTML <ol> compact attribute is not supported by HTML 5 instead of using this we can use the CSS line-height property.

  • <ol compact>: Creates a numbered list; compact made it take less vertical space (obsolete now).
  • Content: Lists HTML, CSS, JS under a green “GeeksforGeeks” heading.
Comment
Article Tags: