Latest web development tutorials

HTML ul compact property

HTML ul tag Reference Manual HTML <ul> tag

Examples

Use compact attribute in unordered list:

<ul compact>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>

try it"

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers do not support the compact attribute.


Definition and Usage

HTML5 does not support the <ul> compact property. Use CSS instead.

<Ul> The compact attribute is deprecated in HTML 4.01.

compact attribute is a boolean (Boolean) property.

compact attribute specifies a list showing the effect of smaller than normal, this is by reducing the line spacing and indentation for the list to achieve.


Compatibility Notes

In HTML 4.01, the attribute is deprecated compact ul element; in XHTML 1.0 Strict DTD not supported compact attribute ul element.

CSS Syntax: <ul style = "line-height: 80%">

CSS Example: to narrow the list row height

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


The difference between HTML and XHTML

In XHTML, the property does not allow short, compact property must be defined as: <ul compact = "compact">.


grammar

<ul compact>


HTML ul tag Reference Manual HTML <ul> tag