文字與排版

列表樣式位置list-style-position

Setting the position of the list item marker.

Overview

ClassDeclarations
list-style:insidelist-style: inside;
list-style:outsidelist-style: outside;
list-style-position:<position>list-style-position: <position>;

Examples

Place markers inside the content box

Use list-style:inside when markers should be part of the text block and align with wrapped lines.

<ul class="list-style:inside">    <li>Long item that wraps inside the same text block.</li></ul>
Generated CSS
@layer utilities {    .list-style\:inside {        list-style: inside    }}

Keep markers outside

Use list-style:outside for the default marker placement outside the principal block box.

<ul class="list-style:outside">    <li>Marker outside</li></ul>

Combine with marker type

You can set position by itself or combine it with type using the list-style:*|* shorthand.

<ul class="list-style:decimal|inside">    <li>Step</li></ul>

Apply conditionally

Apply styles based on different states using selectors and conditional queries.

<ul class="list-style:inside:hover list-style:outside@sm list-style:outside@print">...</ul>

  • Master UI


© 2026 Aoyue Design LLC.MIT License
Trademark Policy