CSS list-style-position Property

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

What You’ll Learn

The list-style-position property controls whether list markers appear inside or outside the list item content box. It affects how bullets, numbers, and wrapped text align.

01

Marker Place

Inside or outside.

02

outside

Default value.

03

inside

Marker in content.

04

Text Wrap

Multi-line lists.

05

ul & ol

Both list types.

06

Inherited

Set on parent.

Introduction

The list-style-position property in CSS is used to specify the position of the list-item marker (such as a bullet or number) in relation to the list item’s content. It primarily applies to <ul> (unordered lists), <ol> (ordered lists), and <li> (list items).

By adjusting this property, you can control whether the marker is placed inside or outside the list item’s content box, allowing for more flexible styling of lists.

Definition and Usage

Apply list-style-position on ul, ol, or individual li elements. For most content lists with wrapping text, outside is the better default. Use inside when you want markers to sit flush with the content edge.

💡
Beginner Tip

The biggest visual difference appears on multi-line list items. Resize a narrow list to see how wrapped lines behave with inside vs outside.

📝 Syntax

The syntax for the list-style-position property is as follows:

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

The value can be either inside or outside.

Basic Example

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

Syntax Rules

  • Only two keyword values are valid: inside and outside.
  • The property is inherited by list items.
  • Works with bullets, numbers, and image markers.
  • Often combined with list-style-type or the list-style shorthand.

⚡ Quick Reference

QuestionAnswer
Initial valueoutside
Applies toList items (display: list-item)
InheritedYes
AnimatableNo
Common useMulti-line lists, compact layouts, and custom marker alignment

💎 Property Values

ValueExampleMeaning
outsidelist-style-position: outside;Marker sits outside the content box; wrapped text aligns under the text start (default)
insidelist-style-position: inside;Marker sits inside the content box; wrapped text aligns under the marker
inheritlist-style-position: inherit;Inherits the value from the parent element
outside inside

🎯 Default Value

The default value of the list-style-position property is outside. This means the marker is placed outside the list item’s content box by default.

👀 Live Preview

Compare default outside markers with inside markers:

outside (default)
  • First item
  • Second item with longer text that wraps to show alignment behavior
inside
  • First item
  • Second item with longer text that wraps to show alignment behavior

Examples Gallery

Compare outside and inside on unordered lists, see wrapping behavior, style ordered lists, and combine with the list-style shorthand.

🔢 Inside vs Outside

Start with the reference example — one list uses the default outside value, the second uses inside.

Example 1 — Outside and Inside Lists

Demonstrate list-style-position with an unordered list using both values.

list-style-position.html
<style>
  .outside {
    list-style-position: outside;
  }
  .inside {
    list-style-position: inside;
  }
</style>

<h2>Outside (Default)</h2>
<ul class="outside">
  <li>Item 1</li>
  <li>Item 2</li>
  <li>Item 3</li>
</ul>

<h2>Inside</h2>
<ul class="inside">
  <li>Item 1</li>
  <li>Item 2</li>
  <li>Item 3</li>
</ul>
Try It Yourself

How It Works

Both lists use the same default disc marker. Only the marker position changes between the two examples.

Example 2 — Multi-line Wrapping Behavior

See how wrapped text aligns differently with outside and inside markers.

list-style-position-wrap.css
.narrow-outside {
  max-width: 14rem;
  list-style-position: outside;
}

.narrow-inside {
  max-width: 14rem;
  list-style-position: inside;
}
Try It Yourself

How It Works

This is the most important practical difference. Use outside when you want clean hanging indents on wrapped list text.

📈 Ordered Lists & Shorthand

Apply marker position to numbered lists and combine with the list-style shorthand.

Example 3 — Ordered List with inside

Position numbers inside the content box on an ordered list.

list-style-position-ol.css
ol.steps {
  list-style-position: inside;
  list-style-type: decimal;
}
Try It Yourself

How It Works

list-style-position works the same way on ordered lists. Numbers appear inside the content box when set to inside.

Example 4 — list-style Shorthand

Set marker type and position together with the list-style shorthand.

list-style-position-shorthand.css
ul.compact {
  list-style: square inside;
}
Try It Yourself

How It Works

The shorthand sets both the square marker type and inside position in one declaration. See the list-style page for the full shorthand syntax.

♿ Accessibility

  • Keep semantic list markup — Marker position is visual; use real ul and ol elements.
  • Prefer outside for long content — Wrapped text is easier to scan when lines hang under the text start.
  • Do not hide meaning in marker styling alone — Important information belongs in the list item text.
  • Screen readers ignore marker position — They still announce list length and item content correctly.
  • Maintain enough spacing — Inside markers can feel cramped on dense multi-line items.

🧠 How list-style-position Works

1

Browser draws a list marker

A bullet, number, or image marker is generated for each list item.

Marker
2

Position chooses the box edge

outside places the marker beside the content box. inside places it within the box.

CSS rule
3

Wrapped text follows the rule

Multi-line items align under the text start (outside) or under the marker (inside).

Layout
=

Controlled list alignment

Lists look cleaner and more intentional in both compact and readable layouts.

🖥 Browser Compatibility

The list-style-position property is widely supported across all modern browsers, including Chrome, Firefox, Safari, Edge, and Opera. This broad compatibility makes it a reliable choice for styling list markers in web projects.

Universal · All browsers

List marker positioning everywhere

list-style-position is a core CSS property supported in all major browsers without polyfills.

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-position property 99% supported

Bottom line: Safe to use everywhere. Test multi-line lists in your layout to choose the best marker position.

🎉 Conclusion

The list-style-position property offers a simple yet powerful way to control the positioning of list-item markers. Whether you want to place markers inside or outside the list item’s content box, this property provides the flexibility to style lists according to your design needs.

Experiment with different positions to achieve the desired look for your lists. For readable content, outside is usually best; for compact layouts, try inside.

💡 Best Practices

✅ Do

  • Use outside for long, multi-line list items
  • Use inside for compact feature lists
  • Combine with list-style-type or shorthand
  • Test narrow containers to see wrapping behavior
  • Keep semantic ul and ol markup

❌ Don’t

  • Assume inside and outside look the same on wrapped text
  • Confuse position with marker type
  • Use inside on dense paragraphs disguised as lists
  • Remove list semantics for layout reasons
  • Forget padding adjustments when switching to inside

Key Takeaways

Knowledge Unlocked

Five things to remember about list-style-position

Use these points when styling list markers.

5
Core concepts
out 02

Default outside

Beside content.

Default
in 03

Inside box

Marker in content.

Values
wrap 04

Text wrap

Key difference.

Pattern
05

Semantic

Keep real lists.

A11y

❓ Frequently Asked Questions

list-style-position controls whether the list marker sits inside or outside the list item content box.
The default value is outside, which places the marker beside the content box in the margin area.
With outside, wrapped text aligns under the text start. With inside, wrapped text aligns under the marker.
Yes. It applies to both ul and ol list items, affecting bullets and numbers alike.
Yes. list-style-position is inherited, so setting it on ul or ol affects nested list items unless they override it.

Practice in the Live Editor

Open the HTML editor, compare inside and outside list markers, 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