Dating back to
RFC 1866 in
November of 1996 (and before, I just can't find the spec), the <ul> is used to represent a
bulleted list.
5.6.1. Unordered List: UL, LI
The <UL> represents a list of items -- typically rendered as a
bulleted list.
The content of a <UL> element is a sequence of <LI> elements.
For example:
<UL>
<LI>First list item
<LI>Second list item
<p>second paragraph of second item
<LI>Third list item
</UL>
The example text renders as:
The <UL> list is one example of the three lists available
within HTML:
- Unordered information
- Ordered information
- Definitions
(Yes boys and girls, that is a <ul> in action).
Such a list must contain one or more list items (designated by the <li> tag). While it does not need to be closed (as of the HTML 4.01 Specification), it is helpful for XHTML and makes some parsers much happier when this is done.
For the <ul>, the start (<ul>) and end (</ul>) tags are both required. For list items, the start tag (<li>) is required, but the end tag is optional.
In unrestricted html (not E2), there are several attributes that may be used within the <ul> tag:
- type = style-information
- Now deprecated. Values may be one of 'disc', 'square' and 'circle'. The correct way to do this now is with the style sheet.
- compact
- Now deprecated. Attempt to render the list in a more compact format.
Other attributes that are universally allowed may also be put inside the <ul> and <li> tags.
As wonderful as the <ul> tag is, it can also be abused in indenting text. The correct way to do this is to use the <blockquote> tag. Likewise, the use of the <li> tag outside of a <ul> or <ol> list is invalid, even though it does give the bullet. Please don't do this.