InfoHeap
Tech
Navigation
  • Home
  • Tutorials
    • CSS tutorials & examples
    • CSS properties
    • Javascript cookbook
    • Linux/Unix Command Line
    • Mac
    • PHP
      • PHP functions online
      • PHP regex
    • WordPress
  • Online Tools
    • Text utilities
    • Online Lint Tools
search

CSS properties

  • CSS3 flexbox
  • all
  • animation
  • background-color
  • background-image
  • border
  • border-color
  • border-radius
  • border-style
  • border-width
  • bottom
  • box-shadow
  • box-sizing
  • calc function
  • clip
  • color
  • color value currentColor
  • color values
  • cursor
  • float
  • font
  • font-family
  • font-size
  • font-style
  • font-variant
  • font-weight
  • generated content
  • left
  • letter-spacing
  • line-height
  • list-style
  • list-style-image
  • list-style-position
  • list-style-type
  • margin
  • max-height
  • max-width
  • min-height
  • min-width
  • opacity
  • outline
  • outline-color
  • outline-style
  • outline-width
  • overflow
  • padding
  • pointer-events
  • position
  • resize
  • right
  • text-align
  • text-decoration
  • text-indent
  • text-overflow
  • text-shadow
  • text-transform
  • top
  • transform
  • transition
  • transition-delay
  • transition-duration
  • transition-property
  • transition-timing-function
  • visibility
  • white-space
  • word-break
  • word-spacing
  • word-wrap/overflow-wrap
  • z-index
 
  • Home
  • > Tutorials
  • > CSS
  • > CSS properties

CSS list-style-position – specify if list markers will be outside or inside

on Mar 13, 2016

CSS list-style-position property specifies the position of the marker box with respect to the principal block box.

  • outside: The marker box is outside the principal block box. This usually results in more indentation by default. But with margin property, it can be reduced.
    list-style-position-outside
  • inside: The marker box is placed as the first inline box in the principal block box.
    list-style-position-inside

CSS property list-style-position

CSS version: CSS 2.1
Value: inside | outside | inherit
Initial: outside
Applies to: elements with 'display: list-item'
Inherited: yes

Example – list-style-position outside

If no value specified for element and its parent, list-style-position takes initial value outside.

<style>
ul {
  background-color: lightgreen;
  width: 200px;
  list-style-position: outside; /* default */
}
li {background-color:lightgray;}
</style>
<ul>
<li>item1</li>
<li>item2</li>
<li>item3</li>
</ul>
refresh done
try it online

Example – list-style-position inside

<style>
ul {
  background-color: lightgreen;
  width: 200px;
  list-style-position: inside;
}
li {background-color:lightgray;}
</style>
<ul>
<li>item1</li>
<li>item2</li>
<li>item3</li>
</ul>
refresh done
try it online

Related

  • CSS list-style - shorthand for list marker type, image and position
  • CSS list-style-type - specify marker (disc, square, numeric, etc.) for a list
  • CSS list-style-image - use image as marker in list
  • HTML li tag
  • HTML ol tag
  • HTML ul tag

Specification

  • W3C CSS 2.1 list-style-position specification
  • W3C CSS 3 list-style-position specification

Suggested posts:

  1. CSS list-style-image – use image as marker in list
  2. CSS list-style-type – specify marker (disc, square, numeric, etc.) for a list
  3. CSS white-space – collaping and wrapping of whitespaces and newlines
  4. CSS animation shorthand property
  5. CSS border-width – set element border width of four sides
  6. wget handy commands
  7. Mac – show volume icon on menu bar
  8. Jenkins – how to setup build cron
Share this article: share on facebook share on linkedin tweet this submit to reddit
Posted in Tutorials | Tagged CSS, CSS properties, Tutorials
  • Browse content
  • Article Topics
  • Article archives
  • Contact Us
Popular Topics: Android Development | AngularJS | Apache | AWS and EC2 | Bash shell scripting | Chrome developer tools | Company results | CSS | CSS cookbook | CSS properties | CSS Pseudo Classes | CSS selectors | CSS3 | CSS3 flexbox | Devops | Git | HTML | HTML5 | Java | Javascript | Javascript cookbook | Javascript DOM | jQuery | Kubernetes | Linux | Linux/Unix Command Line | Mac | Mac Command Line | Mysql | Networking | Node.js | Online Tools | PHP | PHP cookbook | PHP Regex | Python | Python array | Python cookbook | SEO | Site Performance | SSH | Ubuntu Linux | Web Development | Webmaster | Wordpress | Wordpress customization | Wordpress How To | Wordpress Mysql Queries | InfoHeap Money

Copyright © 2025 InfoHeap.

Powered by WordPress