To create an html unordered list, wrap the items in a <ul> element and put each item inside its own <li> element. Browsers show an unordered list as a bulleted list by default, which makes it the right choice for items that have no required order, such as features, ingredients or navigation links.
An unordered list is one of the first structures you learn after headings and paragraphs. It tells browsers, search engines and screen readers that several short items belong together, which plain lines of text cannot do.
<ul> and <li> childrenThe smallest valid list has one <ul> and one or more <li> children. The ul stands for unordered list and li stands for list item.
The browser renders three lines, each starting with a filled bullet. The order in the source is the order on the page, but the markup does not claim that the order matters. If the order does matter, for example in a recipe, use an ordered list instead.
<ul> and <li> childrenThe HTML living standard is strict about what may sit directly inside a <ul>. Only <li> elements (and script-supporting elements such as <script> and <template>) are allowed as direct children. Text placed straight inside the ul is invalid, even though most browsers still display it.
Inside an <li> you can put almost anything: text, links, images, paragraphs, even other lists. The closing </li> tag is optional in the specification, but writing it keeps the markup readable and avoids surprises when you edit later.
Older tutorials use the type attribute on <ul> (values such as circle and square). That attribute is obsolete for ul. Style the marker with the CSS property list-style-type instead.
Common values for list-style-type are disc (the default for top-level lists), circle, square and none. You can also pass a string, as in the last example, or use the ::marker pseudo-element to change the colour and size of bullets.
| CSS value | Result |
|---|---|
disc | Filled round bullet (default) |
circle | Hollow round bullet |
square | Filled square bullet |
none | No marker |
A navigation menu is a list of links, so lists are the standard markup for it. Wrapping the list in a <nav> element gives assistive technology a landmark to jump to.
Developers usually remove the bullets with list-style: none and lay the items out in a row using display: flex. The semantics stay the same: a screen reader still announces "list, 3 items", which helps users understand the menu size.
<br> tags or • characters to fake a list. Real list markup is announced correctly by screen readers and can be restyled with CSS.<li> outside a <ul> or <ol>. A stray li is invalid.list-style: none on a list that is really content. Some screen readers stop announcing it as a list, so keep an aria label or visible bullets when the list matters.type attribute on <ul> or the removed <dir> element.<ul> and <ol>?A <ul> is for items where the order does not matter and shows bullets. An <ol> is for items where the order matters and shows numbers or letters by default.
<ul> inside another <ul>?Yes, but the nested list must sit inside an <li> of the parent list, not directly inside the parent <ul>. Browsers show a different bullet style at each level by default.
Use CSS: list-style: none; on the ul, and usually padding-left: 0; to remove the left indent as well.
<li> tag?The specification allows omitting </li> in many cases, but always closing it is clearer and is what formatters and linters expect.
An unordered list uses <ul> for the container and one <li> per item. Only <li> elements may be direct children of the <ul>, and each item can hold any flow content. Control bullets with CSS list-style-type, not the obsolete type attribute, and use lists for real groups of items such as features and navigation links rather than for visual layout.