HTML Unordered Lists
In this page:
<ul style="list-style-type: value;">
<li>Item</li>
<li>Item</li>
</ul>
Creating a Basic Unordered List
<ul> wraps the whole list, and each individual item goes inside its own <li> (list item) tag. Browsers render each <li> with a bullet point by default, visually signaling that these items form a related but unordered group.
Example: Creating a Basic Unordered List
<ul>
<li>Milk</li>
<li>Bread</li>
</ul>
Nesting Sublists
A sublist is created by placing an entire new <ul> element inside a parent <li>, not after it -- this makes the sublist a genuine child of that specific item, and browsers automatically indent it and often switch the bullet style to visually distinguish nesting depth.
Example: Nesting Sublists
<ul>
<li>Fruits
<ul>
<li>Apple</li>
</ul>
</li>
</ul>
Changing the Bullet Style
list-style-type controls the marker shape shown before each item -- disc (a filled circle, the default), circle (a hollow circle), or square (a filled square) -- letting you visually differentiate nested list levels or match a design's aesthetic.
- Use different list-style-type values across nesting levels to help readers visually distinguish how deep a sublist goes.
- Accepted values:
- list-style-type — disc | circle | square | none (CSS)
- type on ul — obsolete
Example: Changing the Bullet Style
<ul style="list-style-type: square;">
<li>Item one</li>
<li>Item two</li>
</ul>
Removing Bullets for Navigation Menus
list-style: none removes the bullet marker entirely, which is the standard technique used to turn a semantically correct <ul> into a horizontal or vertical navigation menu, keeping the accessible list structure while visually looking nothing like a bulleted list.
Example: Removing Bullets for Navigation Menus
<ul style="list-style: none;">
<li><a href="/">Home</a></li>
<li><a href="/about">About</a></li>
</ul>
Using a Custom Image as a Marker
list-style-image lets you replace the default bullet shape with a small custom image, useful for a branded checklist look, though modern CSS often achieves more consistent, scalable results using a ::marker pseudo-element or a background-image on the li instead.
Example: Using a Custom Image as a Marker
<ul style="list-style-image: url('check.png');">
<li>Completed step</li>
</ul>
- Placing text or other content directly inside <ul> without wrapping it in an <li> element, which is invalid HTML.
- Nesting a new <ul> as a sibling of <li> instead of inside it, which breaks the visual and semantic nesting of a sublist.
- Using list-style: none purely to remove bullets from a navigation menu without considering that this can affect how some screen readers announce list semantics.
- <ul> creates an unordered (bulleted) list, and every item inside it must be wrapped in its own <li> element.
- A nested sublist must be placed entirely inside its parent <li>, not as a sibling after it.
- list-style-type controls the bullet marker shape (disc, circle, square), and list-style: none removes markers entirely.
<ul> and <li> have been part of HTML since its earliest versions and are supported in every browser.
Chapter Quiz — Complete all 26 topics to unlock
0/26 topics done
Complete these topics first:
- HTML Favicon
- HTML Page Title
- HTML Tables
- HTML Lists
- HTML Block & Inline
- HTML Comments
- HTML Colors
- HTML CSS
- HTML Links
- HTML Images
- HTML RGB Colors
- HTML HEX Colors
- HTML HSL Colors
- HTML Link Colors
- HTML Link Bookmarks
- HTML Background Images
- HTML Table Borders
- HTML Table Sizes
- HTML Table Headers
- HTML Table Padding & Spacing
- HTML Colspan & Rowspan
- HTML Table Styling
- HTML Table Colgroup
- HTML Unordered Lists
- HTML Ordered Lists
- HTML Other Lists / Description Lists