CSS list-style Property

Beginner
5 min read
Updated: Oct 2026
3 examples
Live preview

Definition and Usage

The list-style property is a shorthand for list-style-type, list-style-position, and list-style-image. It styles markers on list items (li and display: list-item).

Values can appear in any order. Omitted parts fall back to disc, outside, and none. It is inherited. Nested lists often reset the type unless you set inherit.

Baseline widely available.

Not deprecated. Common keywords like disc, square, decimal, inside, outside, and none are safe. Some exotic counter styles vary by browser.

CSS Syntax

syntax.css
list-style: <type> || <position> || <image> | none | initial | inherit;

Examples: list-style: square; · list-style: square inside; · list-style: none;

Property Values

ValueDescriptionTry it
<type>Marker kind such as disc, square, decimalTry it
inside / outsideMarker position relative to the textTry it
noneNo markerTry it
square insideType and position togetherTry it
initialResets to the initial shorthand defaultsTry it
inheritInherits from the parent (useful for nested lists)Try it

How to Use list-style

Style the list once; markers follow on each item.

  1. Select a ul or ol (or set display: list-item on custom items).
  2. Set list-style to a type, optionally plus inside/outside.
  3. Use none for custom menus, then style with padding and icons if needed.
  4. For nested lists, add list-style: inherit when you want the same marker type.
PieceRequired?Role
TypeOptionalDefaults to disc if omitted
PositionOptionalDefaults to outside
ImageOptionalDefaults to none; type is the fallback if the image fails
noneWhen hiding markersRemoves the list marker

Live Preview

Only the list-style shorthand changes on the sample list.

inside pulls the marker into the text flow. none hides it.

Sample list
  • Apollo
  • Hubble
  • Cassini

list-style: square

CSS Examples

Each snippet focuses on the list-style shorthand. Use Try It Yourself for a live editor.

Example 1 — Change the Marker

Set only the type with one value.

CSS
<style>
  ul {
    list-style: square;
  }
</style>

<ul>
  <li>Apollo</li>
  <li>Hubble</li>
</ul>
Try It Yourself

How It Works

  1. Target the list. Styles on ul apply to its list items.
  2. One keyword. square sets list-style-type; position stays outside.
  3. Fast change. Swap disc, circle, or decimal the same way.
  4. Shorthand win. No need to write the longhand for a simple marker swap.

Example 2 — Type and Position

Place the marker inside the content box.

CSS
<style>
  ul {
    list-style: square inside;
  }
</style>

<ul>
  <li>Short item</li>
  <li>A longer item that wraps under the marker when space is tight.</li>
</ul>
Try It Yourself

How It Works

  1. Two values, any order. Type and position are both set.
  2. Inside flow. inside puts the marker in the content area.
  3. Wrapping differs. Long lines continue under the marker, not beside it.
  4. Default is outside. Omit position when you want the classic hanging marker.

Example 3 — Remove Markers

Hide bullets for a custom list or menu.

CSS
<style>
  ul {
    list-style: none;
    padding-left: 0;
  }
</style>

<ul role="list">
  <li>Home</li>
  <li>Docs</li>
</ul>
Try It Yourself

How It Works

  1. Hide markers. list-style: none removes the bullet or number.
  2. Reset padding. Many browsers indent lists; padding-left: 0 aligns the text.
  3. Keep semantics. role="list" helps Safari announce the list when markers are none.
  4. Common pattern. Navigation menus often use this combo.

Edge Cases & Pitfalls

Markers look simple until nesting or accessibility gets involved.

nest

Nested lists reset the type

Browsers set default types on nested ul/ol. Use list-style: inherit on nested lists to keep your custom marker.

a11y

none and Safari VoiceOver

Safari may not expose a list with list-style: none as a list. Add role="list" when that matters.

image

Type is the image fallback

If list-style-image fails to load, the type marker still shows. Keep a sensible type when you use an image.

order

Value order is flexible

square inside and inside square both work. The browser maps each token to the matching longhand.

display

Needs list items

Markers apply to list items. A plain div needs display: list-item to show them.

Browser Support

list-style is a browser CSS shorthand for list markers. Node.js, Deno, and Bun do not apply it.

✓ Baseline · Widely available

list-style

Common types, inside/outside, none, and images are widely supported. Some specialized counter styles vary by browser.

100% Common values
Google Chrome All versions
Full support
Mozilla Firefox All versions
Full support
Apple Safari All versions
Full support
Microsoft Edge All versions
Full support
Opera All versions
Full support
Samsung Internet All versions
Full support
Internet Explorer All versions
Full support
list-style Widely supported

Bottom line: Safe for everyday list styling. Prefer standard types for study. It is not a runtime API.

Key Takeaways

  • Role: shorthand for type, position, and image of list markers.
  • Defaults: disc / outside / none.
  • none: hide markers; consider role="list" for Safari.
  • Nested lists: use inherit if you want the same type.

One line: list-style is the quick way to set list markers — type, position, and optional image in one go.

Frequently Asked Questions

It is a shorthand for list-style-type, list-style-position, and list-style-image. One declaration can set the marker kind, where it sits, and an optional image.
The longhands default to disc, outside, and none — a filled circle marker outside the content, with no custom image.
It hides the marker. Useful for nav menus built with ul. In Safari, also consider role="list" so the list stays announced as a list.
Not always. User-agent styles reset list-style-type on nested lists. Set list-style: inherit on nested lists if you want the same marker.
Yes. Values can appear in any order, such as list-style: square inside.
It is Baseline and widely available for common types, inside/outside, none, and images. It is a browser CSS property, not a Node.js feature.

Next: list-style-image

Learn how to use a custom image as a list marker.

list-style-image tutorial →

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.

8 people found this page helpful