CSS list-style-position Property

CSS list-style-position property specifies the position of the list items marker. The position of the marker is relative to the list items.

The position of the marker can either be inside the list-items or outside the list-items. See the example below:

Example:

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

CSS Syntax

The list-style-position property has the following syntax:

list-style-position: outside|inside|initial|inherit;

Property Values

The list-style-position property accepts the following values:

outsideThe position of the marker is outside the list-items.
insideThe position of the marker is inside the list-items.
initialSets the list-style-position property to its default value(outside).
inheritInherits the list-style-position property from the parent element.

General Info

Default Valueoutside
InheritedYes
JavaScript Usageelement.style.listStylePosition = “inside”

Author

  • Manoj Kumar

    Hi, My name is Manoj Kumar. I am a full-stack developer with a passion for creating robust and efficient web applications. I have hands-on experience with a diverse set of technologies, including but not limited to HTML, CSS, JavaScript, TypeScript, Angular, Node.js, Express, React, and MongoDB.

    View all posts

Leave a Comment