First, we consider a single, pure list item. This list item has no marker (otherwise known as a "bullet") and is not yet part of a list itself. It hangs alone in the void, simple and unadorned, as shown in Figure 1.
That dotted red border represents the outer edges of the content area of the list item. Remember that, at this point, the list item has no padding or borders. If we add two more list items, we get a result like that shown in Figure 2.
Now we wrap these in a parent element; in this case, we'll wrap them in an unordered list (i.e., <ul>
). According to the CSS box model, the list items' boxes must be displayed within the parent element's content area. Since that parent has no padding or margins yet, we get the situation shown in Figure 3.
Here, the dotted blue border shows us the edges of the <ul>
element's content area. Since we have no padding for the <ul>
element, its content wraps snugly around the three list items.
Now we add the list item markers. Since this is an unordered list, we'll add traditional filled-circle "bullets," as shown in Figure 4.
Visually, the markers are outside the content area of the <ul>
, but that's not the important part here. What's key is that the markers are placed outside the "principal box" of the <li>
elements, not the <ul>
. They're sort of like appendages to the list items, hanging outside the content-area of the <li>
but still attached to the <li>
.
This is why, in every modern browser, markers are placed outside any border set for an <li>
element, assuming the value of list-style-position
is outside
. If it's changed to inside
, then the markers are brought inside the <li>
's content, as though they're an inline box placed at the very beginning of the <li>
.