ul

< html‎ | elements
Jump to: navigation, search

ul – unordered list

This article is In Progress.


W3C Recommendation

ul

For technical reasons, the title of this article is not the text used to call this API. Instead, use ul

Summary

The ul element is used to define an unordered list. The element encloses one or more list items, enclosed in li elements.


Overview Table

DOM Interface HTMLUListElement
Permitted contents One of the following:
  • Either: Zero or more li elements.
  • Or: A template element.
  • Or: any combination of the above two
Permitted parents Any element that can contain flow content.
Tag omission A ul element must have both a start tag and an end tag.


The unordered list, represented by the ul element, is most often used to group a list of items, enclosed in li elements, together in a semantic way. Usually, the order in which the items are presented is not important.


Compatibility

There is no data available for topic "html", feature "ul". If you think that there should be data available, consider opening an issue.

Examples

This example uses the ul element to create a bulleted list.

HTML

<ul>
<li>This is the first bulleted item in the list.</li>
<li>And this is the second bulleted item in the list.</li>
</ul>

Typical browser default CSS properties for the ul element.

CSS

display: block;
list-style-type: disc;
margin-top: 16px;
margin-bottom: 16px;

Notes

Remarks

The type attribute sets the list type for all ensuing lists unless a different type value is set. The ul element inherits its line-height from the height of the font attribute for the body. For example, if the font-size attribute for the body is larger than the font-size attribute for the ul element, the list items in the ul are spaced according to the font-size of the body.

Standards information

Related specifications

Specification Status Related Changes
HTML 5 W3C Candidate Recommendation

See also

Other articles

Attribution

This article contains content originally from external sources.

Portions of this content come from the Microsoft Developer Network: [Windows Internet Explorer API reference Article]