HTML <ul> tag
In HTML, the <ul> tag creates an unordered list.
By default, the items under an unordered list are bullet points so it is also called as bulleted list.
To create the list of items inside the unordered list, you should use the <li> tag.
Syntax:
<ul>list elements…</ul>
Example
<ul> <li>January</li> <li>February</li> <li>March</li> <li>April</li> <li>May</li> <li>June</li> <li>July</li> <li>August</li> <li>September</li> <li>October</li> <li>November</li> <li>December</li> </ul>
CSS Default Values
display: block;
list-style-type: disc;
margin-top: 1em;
margin-bottom: 1 em;
margin-left: 0;
margin-right: 0;
padding-left: 40px;
How Browser will display
INLINE.
Difference between HTML4.01, XHTML and HTML5
HTML4 | XHTML | HTML5 |
---|---|---|
None | None | In HTML5, the compact and type attributes are deprecated. |
Attributes used with <ul> tag
Attribute | Description |
---|---|
type | To define the type of marker for the items of the unordered list. This tag can take any one of these values - |
compact | To make the list compact. This makes the list appear smaller than the normal size. (HTML5 does not support the <compact> attribute) |
Global Attributes
The <ul> tag supports Global attributes.
Event Attributes
The <ul> tag supports Event attributes.
Supporting Browsers
Related Tags
<ol> and <li> tags.