CSS list-style Property

Beginner
⏱️ 5 min read
📚 Updated: Jun 2026
🎯 4 Examples
Lists

What You’ll Learn

The list-style property is a shorthand for controlling list markers. It lets you customize bullets, numbers, marker position, and optional marker images on <ul> and <ol> lists.

01

Shorthand

Three sub-properties.

02

Markers

Bullets and numbers.

03

Position

inside or outside.

04

Images

Custom markers.

05

none

Remove bullets.

06

Inherited

Set on ul or ol.

Introduction

The list-style property in CSS is a shorthand property for setting all the list properties in one declaration. It can be used to control the appearance of list items, including the type of bullet or numbering, the position of the marker, and an image to use as a marker.

This property is commonly used with unordered (<ul>) and ordered (<ol>) lists to enhance their presentation. You will also use it when building navigation menus, feature lists, and step-by-step instructions.

Definition and Usage

Apply list-style on ul, ol, or individual li elements. The shorthand accepts up to three values in any order: list-style-type, list-style-position, and list-style-image.

💡
Beginner Tip

If you only need to change the bullet shape, write something simple like list-style: square;. You do not have to set all three parts every time.

📝 Syntax

The syntax for the list-style property allows you to set three sub-properties at once:

syntax.css
selector {
  list-style: list-style-type list-style-position list-style-image;
}

Sub-Properties

  • list-style-type — Specifies the type of list item marker (disc, square, decimal, etc.).
  • list-style-position — Specifies whether the marker sits inside or outside the list item.
  • list-style-image — Specifies an image URL to use as the list item marker.

Basic Example

list-style.css
ul {
  list-style: square inside;
}

Syntax Rules

  • Any omitted value resets to its initial default.
  • If a valid image is supplied, it takes priority over the marker type.
  • The property is inherited by list items.
  • Use none as the type to remove markers entirely.

⚡ Quick Reference

QuestionAnswer
Initial valuedisc outside none
Applies toList items (display: list-item)
InheritedYes
AnimatableNo
Common useCustom bullets, numbered steps, and unstyled nav lists

💎 Property Values

list-style-type

ValueDescription
discFilled circle (default for unordered lists)
circleHollow circle
squareFilled square
decimalNumbers (1, 2, 3, …)
lower-alphaLowercase alphabet (a, b, c, …)
upper-alphaUppercase alphabet (A, B, C, …)
noneNo marker

list-style-position

ValueDescription
outsideMarker is outside the list item (default)
insideMarker is inside the list item content box

list-style-image

ValueDescription
url(path/to/image)Uses an image as the list item marker
noneNo image is used (default)
disc outside none square inside decimal none

🎯 Default Value

The default value for the list-style property is disc outside none. This means list items use a disc marker, the marker sits outside the list item, and no custom image is used.

👀 Live Preview

An unordered list with list-style: square inside:

square inside
  • First item
  • Second item with longer text that wraps to show inside marker behavior
  • Third item

Examples Gallery

Create custom unordered lists, style ordered lists, compare inside vs outside markers, and remove bullets for navigation menus.

🔢 Custom Unordered Lists

Start with the reference example — a list with square markers positioned inside each item.

Example 1 — Square Markers Inside

Create a list with custom list-style properties.

list-style.html
<style>
  ul.custom-list {
    list-style: square inside;
  }
</style>

<ul class="custom-list">
  <li>First item</li>
  <li>Second item</li>
  <li>Third item</li>
</ul>

In this example:

  • list-style-type is set to square.
  • list-style-position is set to inside.
  • list-style-image defaults to none because no image URL is provided.
Try It Yourself

How It Works

The shorthand sets a square marker and places it inside the content box, so wrapped text aligns under the first line of each item.

Example 2 — Ordered List with lower-alpha

Style numbered and lettered lists with list-style-type.

list-style-ordered.css
ol.steps {
  list-style: lower-alpha outside;
}
Try It Yourself

How It Works

Ordered lists accept counter styles like decimal, lower-alpha, and upper-alpha through the same shorthand.

📈 Position & Navigation

Compare marker placement and remove bullets for horizontal navigation patterns.

Example 3 — Inside vs Outside

See how marker position changes text alignment when items wrap.

list-style-position.css
.outside { list-style: disc outside; }
.inside { list-style: disc inside; }
Try It Yourself

How It Works

outside is the default and usually looks cleaner for multi-line list items. inside keeps markers aligned with the content box edge.

Example 4 — Navigation List with no Markers

Remove bullets when a list is used for navigation rather than content.

list-style-none.css
nav ul {
  list-style: none;
  display: flex;
  gap: 1rem;
  padding: 0;
  margin: 0;
}
Try It Yourself

How It Works

list-style: none hides markers while keeping semantic list markup. Pair it with flexbox for horizontal nav layouts.

♿ Accessibility

  • Keep semantic lists — Use real ul and ol elements instead of divs with manual bullets.
  • Do not remove markers without reason — If content is a true list, markers help users scan items.
  • Ensure sufficient contrast — Custom marker colors should remain visible against the background.
  • Screen readers still announce list length — Removing bullets visually does not remove list semantics.
  • Nested lists need clear hierarchy — Use proper nesting and consistent marker styles at each level.

🧠 How list-style Works

1

You style a list element

Apply list-style on ul, ol, or li with type, position, and optional image values.

CSS rule
2

Browser picks a marker

A bullet, number, letter, custom image, or no marker is chosen based on your shorthand values.

Rendering
3

Position controls alignment

inside or outside determines where the marker sits relative to list item text.

Layout
=

Styled lists

Content lists, steps, and navigation can match your site design while staying semantic.

🖥 Browser Compatibility

The list-style property is supported in all modern browsers, including Chrome, Firefox, Safari, Edge, and Opera. It is widely used and has broad compatibility, making it a reliable choice for styling lists.

Universal · All browsers

List styling everywhere

list-style is a core CSS property supported since early browser versions. Safe for any web project.

99% Global browser support
Google Chrome All versions · Desktop & Mobile
Full support
Mozilla Firefox All versions · Desktop & Mobile
Full support
Apple Safari All versions · macOS & iOS
Full support
Microsoft Edge All versions · Legacy & Chromium
Full support
Opera All versions · Modern & legacy
Full support
list-style property 99% supported

Bottom line: Safe to use everywhere. For custom image markers, see the dedicated list-style-image property page.

🎉 Conclusion

The list-style property in CSS provides a simple way to customize the appearance of list items. By adjusting the type, position, and image of the list markers, you can create visually appealing lists that fit the design of your website.

Experiment with different values and combinations to achieve the desired look for your lists. Start with marker types like square or decimal, then explore position and image options as your designs grow more advanced.

💡 Best Practices

✅ Do

  • Use semantic ul and ol elements for real lists
  • Prefer outside for multi-line content lists
  • Use list-style: none for navigation menus
  • Match marker style to your design system
  • Learn the longhand properties when you need fine control

❌ Don’t

  • Replace lists with divs just to avoid default bullets
  • Use hard-to-see marker colors on busy backgrounds
  • Mix too many marker styles on one page
  • Forget padding when removing default list indentation
  • Depend on broken image URLs for list markers

Key Takeaways

Knowledge Unlocked

Five things to remember about list-style

Use these points when styling HTML lists.

5
Core concepts
disc 02

Default disc

outside none.

Default
1. 03

Marker types

Bullets and numbers.

Values
in 04

Position

inside or outside.

Pattern
05

Semantic

Keep real lists.

A11y

❓ Frequently Asked Questions

list-style is a shorthand that sets list-style-type, list-style-position, and list-style-image in one declaration. It controls bullets, numbers, marker position, and optional marker images.
The default is disc outside none — a filled circle marker outside the list item with no custom image.
outside places the marker in the margin area beside the text. inside places the marker inside the list item content box, so text wraps under the marker.
Yes. Use list-style: none or list-style-type: none to hide markers. This is common for navigation menus built with ul or ol.
Yes. list-style is inherited, so setting it on ul or ol affects list items unless they override it.

Practice in the Live Editor

Open the HTML editor, try different list-style values on ul and ol elements, and preview the results instantly.

HTML Editor →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

5 people found this page helpful