Lists
list-style-position
list-style-position sets whether the list marker sits outside the item or inside it.
Syntax
inside | outsidePreview
りんご
Banana
みかん
Presets
Drag the bottom-right corner to resize
Code
.box {
list-style-position: inside;
}Controls
list-style-positioninside
りんご
Banana
みかん
About
What the values mean
outside: puts the marker outside the item’s box (to the left in horizontal text). This is the initial value. When an item wraps, the following lines line up with the start of the first line’s text.inside: puts the marker inside the item, as if it were the first character of the first line. Wrapped lines start at the item’s edge, under the marker.
The items in the preview here are tinted, so you can see whether the marker is outside or inside each item’s box.
Watch out
- An
outsidemarker lives in the left padding of theulorol(browsers default topadding-left: 40px). Set it to 0 and the marker spills out of the box, whereoverflow: hiddenand the like can cut it off. - It is inherited, so you can set it once on
ulorol. The shorthandlist-style: square insidesets it together with the marker type.