CSS

🎯 CSS list-style-position Property

The CSS list-style-position property defines where the list marker (bullet or number) is placed in relation to the list item content. It controls whether the marker appears inside or outside the content box of the list item.

In simple terms, it decides how list bullets or numbers align with text inside <ul> and <ol> elements.

🔹 Values of list-style-position

1️⃣ outside (Default)

The default value. The marker is placed outside the content box of the list item. If the text wraps, the second line is not aligned under the marker.

CSS

ul {
  list-style-position: outside;
}
                

Example result:

• Lorem ipsum dolor sit amet,
consectetur adipiscing elit.

✔ The bullet stays outside the text block.

2️⃣ inside

The marker is placed inside the content box. If the text wraps, the second line aligns with the bullet.

CSS

ul {
  list-style-position: inside;
}
                

• Lorem ipsum dolor sit amet,
consectetur adipiscing elit.

✔ The text behaves like part of the list item block.

3️⃣ initial

Resets the property to its default value (outside).

CSS

ul {
  list-style-position: initial;
}
                

4️⃣ inherit

Inherits the value from the parent element.

CSS

ul {
  list-style-position: inherit;
}
                

🧪 Quick Comparison

Value Description
outside Marker is outside the text block (default)
inside Marker is inside and text aligns with it
initial Resets to default value (outside)
inherit Takes value from parent element
  • 🧠 Summary

  • list-style-position controls where list markers appear
  • outside places markers outside the text (default behavior)
  • inside places markers inside the content box
  • Useful for improving list layout and readability in UI design