files/en-us/web/html/reference/elements/ul/index.md
The <ul> HTML element represents an unordered list of items, typically rendered as a bulleted list.
{{InteractiveExample("HTML Demo: <ul>", "tabbed-standard")}}
<ul>
<li>Milk</li>
<li>
Cheese
<ul>
<li>Blue cheese</li>
<li>Feta</li>
</ul>
</li>
</ul>
li {
list-style-type: circle;
}
li li {
list-style-type: square;
}
This element includes the global attributes.
compact {{Deprecated_inline}}
compact attribute, the CSS property {{cssxref("line-height")}} can be used with a value of 80%.type {{Deprecated_inline}}
: This attribute sets the bullet style for the list. The values defined under HTML3.2 and the transitional version of HTML 4.0/4.01 are:
circlediscsquareA fourth bullet type has been defined in the WebTV interface, but not all browsers support it: triangle.
If not present and if no CSS {{ cssxref("list-style-type") }} property applies to the element, the user agent selects a bullet type depending on the nesting level of the list.
[!WARNING] Do not use this attribute, as it has been deprecated; use the CSS {{ cssxref("list-style-type") }} property instead.
<ul> element is for grouping a collection of items that do not have a numerical ordering, and their order in the list is meaningless. Typically, unordered-list items are displayed with a bullet, which can be of several forms, like a dot, a circle, or a square. The bullet style is not defined in the HTML description of the page, but in its associated CSS, using the {{ cssxref("list-style-type") }} property.<ul> and {{HTMLElement("ol")}} elements may be nested as deeply as desired. Moreover, the nested lists may alternate between <ol> and <ul> without restriction.<ul> elements both represent a list of items. They differ in that, with the {{ HTMLElement("ol") }} element, the order is meaningful. To determine which one to use, try changing the order of the list items; if the meaning is changed, the {{ HTMLElement("ol") }} element should be used, otherwise you can use <ul>.<ul>
<li>first item</li>
<li>second item</li>
<li>third item</li>
</ul>
{{EmbedLiveSample("Basic_example", 400, 120)}}
<ul>
<li>first item</li>
<li>
second item
<!-- Look, the closing </li> tag is not placed here! -->
<ul>
<li>second item first subitem</li>
<li>
second item second subitem
<!-- Same for the second nested unordered list! -->
<ul>
<li>second item second subitem first sub-subitem</li>
<li>second item second subitem second sub-subitem</li>
<li>second item second subitem third sub-subitem</li>
</ul>
</li>
<!-- Closing </li> tag for the li that
contains the third unordered list -->
<li>second item third subitem</li>
</ul>
<!-- Here is the closing </li> tag -->
</li>
<li>third item</li>
</ul>
{{EmbedLiveSample("Nesting_a_list", 400, 340)}}
<ul>
<li>first item</li>
<li>
second item
<!-- Look, the closing </li> tag is not placed here! -->
<ol>
<li>second item first subitem</li>
<li>second item second subitem</li>
<li>second item third subitem</li>
</ol>
<!-- Here is the closing </li> tag -->
</li>
<li>third item</li>
</ul>
{{EmbedLiveSample("Ordered_list_inside_unordered_list", 400, 190)}}
{{Specifications}}
{{Compat}}
<ul> element:
compact attribute.