メインコンテンツへスキップ

ol要素


1.仕様

OL要素は、
順序付けられている
項目の一覧を
表します。

OL - - (li)* +(%Scriptsupporting) -- ordered list. (Normal elements.) [Flow|Palpablelimited] --

ol

順序付き一覧 (ordered list)

種類

通常要素

カテゴリ
  • フローコンテンツ
  • パルパブルコンテンツ(条件付き)

要素の子に少なくとも1つの li要素が含まれる場合は、パルパブルコンテンツ。

コンテンツモデル
0個以上の<li>要素 オプションでスクリプトをサポートする要素が混在

0個以上の<li>要素が配置できます。オプションで、スクリプトをサポートする要素を混在して配置できます。

スクリプトをサポートする要素に分類される要素は、<script>要素, <template>要素 です。

タグの省略

どちらのタグも省略できません。

コンテンツ属性
グローバル属性 他
reversed属性
リストが降順
start属性
マーカーの開始値
type属性
マーカーの種類
DOM インターフェイス
HTMLOListElement
  1. [Exposed=Window]
  2. interface HTMLOListElement : HTMLElement {
  3. lastReviewed;
  4. [HTMLConstructor] constructor();
  5.  
  6. [CEReactions] attribute boolean reversed;
  7. [CEReactions] attribute long start;
  8. [CEReactions] attribute DOMString type;
  9.  
  10. // also has obsolete members
  11. };
HTMLElement
  1. [Exposed=Window]
  2. interface HTMLElement : Element {
  3. [HTMLConstructor] constructor();
  4.  
  5. // metadata attributes
  6. [CEReactions] attribute DOMString title;
  7. [CEReactions] attribute DOMString lang;
  8. [CEReactions] attribute boolean translate;
  9. [CEReactions] attribute DOMString dir;
  10.  
  11. // user interaction
  12. [CEReactions] attribute (boolean or unrestricted double or DOMString)? hidden;
  13. [CEReactions] attribute DOMString inert;
  14. undefined click();
  15. [CEReactions] attribute DOMString accessKey;
  16. readonly attribute DOMString accessKeyLabel;
  17. [CEReactions] attribute boolean draggable;
  18. [CEReactions] attribute boolean spellcheck;
  19. [CEReactions] attribute DOMString writingSuggestions;
  20. [CEReactions] attribute DOMString autocapitalize;
  21.  
  22. [CEReactions] attribute [LegacyNullToEmptyString] DOMString innerText;
  23. [CEReactions] attribute [LegacyNullToEmptyString] DOMString outerText;
  24.  
  25. ElementInternals attachInternals();
  26.  
  27. // The popover API
  28. undefined showPopover();
  29. undefined hidePopover();
  30. boolean togglePopover(optional boolean force);
  31. [CEReactions] attribute DOMString? popover;
  32. };
  33.  
  34. HTMLElement includes GlobalEventHandlers;
  35. HTMLElement includes ElementContentEditable;
  36. HTMLElement includes HTMLOrSVGElement;
Element
  1. [Exposed=Window]
  2. interface Element : Node {
  3. readonly attribute DOMString? namespaceURI;
  4. readonly attribute DOMString? prefix;
  5. readonly attribute DOMString localName;
  6. readonly attribute DOMString tagName;
  7.  
  8. [CEReactions] attribute DOMString id;
  9. [CEReactions] attribute DOMString className;
  10. [SameObject, PutForwards=value] readonly attribute DOMTokenList classList;
  11. [CEReactions, Unscopable] attribute DOMString slot;
  12.  
  13. boolean hasAttributes();
  14. [SameObject] readonly attribute NamedNodeMap attributes;
  15. sequence<DOMString> getAttributeNames();
  16. DOMString? getAttribute(DOMString qualifiedName);
  17. DOMString? getAttributeNS(DOMString? namespace, DOMString localName);
  18. [CEReactions] undefined setAttribute(DOMString qualifiedName, DOMString value);
  19. [CEReactions] undefined setAttributeNS(DOMString? namespace, DOMString qualifiedName, DOMString value);
  20. [CEReactions] undefined removeAttribute(DOMString qualifiedName);
  21. [CEReactions] undefined removeAttributeNS(DOMString? namespace, DOMString localName);
  22. [CEReactions] boolean toggleAttribute(DOMString qualifiedName, optional boolean force);
  23. boolean hasAttribute(DOMString qualifiedName);
  24. boolean hasAttributeNS(DOMString? namespace, DOMString localName);
  25.  
  26. Attr? getAttributeNode(DOMString qualifiedName);
  27. Attr? getAttributeNodeNS(DOMString? namespace, DOMString localName);
  28. [CEReactions] Attr? setAttributeNode(Attr attr);
  29. [CEReactions] Attr? setAttributeNodeNS(Attr attr);
  30. [CEReactions] Attr removeAttributeNode(Attr attr);
  31.  
  32. ShadowRoot attachShadow(ShadowRootInit init);
  33. readonly attribute ShadowRoot? shadowRoot;
  34.  
  35. Element? closest(DOMString selectors);
  36. boolean matches(DOMString selectors);
  37. boolean webkitMatchesSelector(DOMString selectors); // legacy alias of .matches
  38.  
  39. HTMLCollection getElementsByTagName(DOMString qualifiedName);
  40. HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName);
  41. HTMLCollection getElementsByClassName(DOMString classNames);
  42.  
  43. [CEReactions] Element? insertAdjacentElement(DOMString where, Element element); // legacy
  44. undefined insertAdjacentText(DOMString where, DOMString data); // legacy
  45. };
GlobalEventHandlers
  1. interface mixin GlobalEventHandlers {
  2. attribute EventHandler onabort;
  3. attribute EventHandler onauxclick;
  4. attribute EventHandler onbeforeinput;
  5. attribute EventHandler onbeforematch;
  6. attribute EventHandler onbeforetoggle;
  7. attribute EventHandler onblur;
  8. attribute EventHandler oncancel;
  9. attribute EventHandler oncanplay;
  10. attribute EventHandler oncanplaythrough;
  11. attribute EventHandler onchange;
  12. attribute EventHandler onclick;
  13. attribute EventHandler onclose;
  14. attribute EventHandler oncontextlost;
  15. attribute EventHandler oncontextmenu;
  16. attribute EventHandler oncontextrestored;
  17. attribute EventHandler oncopy;
  18. attribute EventHandler oncuechange;
  19. attribute EventHandler oncut;
  20. attribute EventHandler ondblclick;
  21. attribute EventHandler ondrag;
  22. attribute EventHandler ondragend;
  23. attribute EventHandler ondragenter;
  24. attribute EventHandler ondragleave;
  25. attribute EventHandler ondragover;
  26. attribute EventHandler ondragstart;
  27. attribute EventHandler ondrop;
  28. attribute EventHandler ondurationchange;
  29. attribute EventHandler onemptied;
  30. attribute EventHandler onended;
  31. attribute OnErrorEventHandler onerror;
  32. attribute EventHandler onfocus;
  33. attribute EventHandler onformdata;
  34. attribute EventHandler oninput;
  35. attribute EventHandler oninvalid;
  36. attribute EventHandler onkeydown;
  37. attribute EventHandler onkeypress;
  38. attribute EventHandler onkeyup;
  39. attribute EventHandler onload;
  40. attribute EventHandler onloadeddata;
  41. attribute EventHandler onloadedmetadata;
  42. attribute EventHandler onloadstart;
  43. attribute EventHandler onmousedown;
  44. [LegacyLenientThis] attribute EventHandler onmouseenter;
  45. [LegacyLenientThis] attribute EventHandler onmouseleave;
  46. attribute EventHandler onmousemove;
  47. attribute EventHandler onmouseout;
  48. attribute EventHandler onmouseover;
  49. attribute EventHandler onmouseup;
  50. attribute EventHandler onpaste;
  51. attribute EventHandler onpause;
  52. attribute EventHandler onplay;
  53. attribute EventHandler onplaying;
  54. attribute EventHandler onprogress;
  55. attribute EventHandler onratechange;
  56. attribute EventHandler onreset;
  57. attribute EventHandler onresize;
  58. attribute EventHandler onscroll;
  59. attribute EventHandler onscrollend;
  60. attribute EventHandler onsecuritypolicyviolation;
  61. attribute EventHandler onseeked;
  62. attribute EventHandler onseeking;
  63. attribute EventHandler onselect;
  64. attribute EventHandler onslotchange;
  65. attribute EventHandler onstalled;
  66. attribute EventHandler onsubmit;
  67. attribute EventHandler onsuspend;
  68. attribute EventHandler ontimeupdate;
  69. attribute EventHandler ontoggle;
  70. attribute EventHandler onvolumechange;
  71. attribute EventHandler onwaiting;
  72. attribute EventHandler onwebkitanimationend;
  73. attribute EventHandler onwebkitanimationiteration;
  74. attribute EventHandler onwebkitanimationstart;
  75. attribute EventHandler onwebkittransitionend;
  76. attribute EventHandler onwheel;
  77. };
ElementContentEditable
  1. interface mixin ElementContentEditable {
  2. [CEReactions] attribute DOMString contentEditable;
  3. [CEReactions] attribute DOMString enterKeyHint;
  4. readonly attribute boolean isContentEditable;
  5. [CEReactions] attribute DOMString inputMode;
  6. };
HTMLOrSVGElement
  1. interface mixin HTMLOrSVGElement {
  2. [SameObject] readonly attribute DOMStringMap dataset;
  3. attribute DOMString nonce; // intentionally no [CEReactions]
  4.  
  5. [CEReactions] attribute boolean autofocus;
  6. [CEReactions] attribute long tabIndex;
  7. undefined focus(optional FocusOptions options = {});
  8. undefined blur();
  9. };
ARIA in HTML
暗黙的="list" ARIAロール="あり" aria-* 属性="GlobalAny"

暗黙的な ARIAセマンティクスは、role=list です。

作成者が要素に指定してもよい ARIAロール値は、 group, listbox, menu, menubar, none, presentation, radiogroup, tablist, toolbar, tree です。

グローバル aria-* 属性と、許可されたロールに適用される任意の aria-* 属性が記述できます。

レンダリング
ブロックボックス
リスト
  1. ol {
  2. display: block;
  3. margin-block: 1em;
  4. padding-inline-start: 40px;
  5. counter-reset: list-item;
  6. list-style-type: decimal;
  7. unicode-bidi: isolate;
  8. }
  9. :is(dir, dl, menu, ol, ul) ol {
  10. margin-block: 0;
  11. }
  12. ol[type="1"] {
  13. list-style-type: decimal;
  14. }
  15. ol[type=a s] {
  16. list-style-type: lower-alpha;
  17. }
  18. ol[type=A s] {
  19. list-style-type: upper-alpha;
  20. }
  21. ol[type=i s] {
  22. list-style-type: lower-roman;
  23. }
  24. ol[type=I s] {
  25. list-style-type: upper-roman;
  26. }

CSS を大雑把に読むと、 ブロックレベルのブロックコンテナボックス(ブロックボックス)を生成します。 などになります。

説明
ol要素は、順序付けられている項目の一覧を表します。

ol要素は、項目(アイテム・item)の一覧(リスト・list)を表します。項目が意図的に順序付けられている為、順序を変更すると文書(ドキュメント・document)の意味が変わります。項目の順序に意味がない場合は、ul要素を用います。
リストの項目は、ol要素の li要素の子ノードで、ツリー順になっています。

  1. <!DOCTYPE html>
  2. <html lang="ja">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>ol要素の例 - (Example of ol element) | 離珠のHTMLでしぃ!</title>
  6. <meta name="author" content="コータン (KOUTAN)">
  7. <link rel="icon" href="../favicon.ico" type="image/vnd.microsoft.icon">
  8. </head>
  9. <body>
  10. <h1>ol要素の例</h1>
  11. <ol>
  12. <li>1番目のアイテム</li>
  13. <li>2番目のアイテム</li>
  14. </ol>
  15. </body>
  16. </html>

このサンプルへのリンクです。
(./exol.htm)

JSONデータ
JSON形式での、データのイメージです。
  1. {
  2. "ol": {
  3. "group": "Lists",
  4. "element": "- - (li)* +(%Scriptsupporting) -- ordered list. (Normal elements.) [Flow|Palpablelimited] --",
  5. "attlist": {
  6. "%Global;": "",
  7. "reversed": "(reversed) #IMPLIED -- Number the list backwards --",
  8. "start": "NUMBER #IMPLIED -- Starting value of the list --",
  9. "type": "CDATA #IMPLIED -- Kind of list marker --",
  10. },
  11. "summary": "順序付き一覧 (ordered list)",
  12. "point": "順序付けられている項目の一覧を表します。",
  13. "description": [
  14. "項目(アイテム・item)の一覧(リスト・list)を表します。項目が意図的に順序付けられている為、順序を変更すると文書(ドキュメント・document)の意味が変わります。項目の順序に意味がない場合は、ul要素を用います。",
  15. "リストの項目は、ol要素の li要素の子ノードで、ツリー順になっています。",
  16. ],
  17. "elementKind": "Normal",
  18. "categories": [
  19. "Flow",
  20. "Palpablelimited",
  21. ],
  22. "categoriessupplement": "要素の子に少なくとも1つの li要素が含まれる場合は、パルパブルコンテンツ。",
  23. "canUsedContexts": "parent (%Flow)*",
  24. "contentModel": "ol (li)* +(%Scriptsupporting)",
  25. "tagOmission": [
  26. "-",
  27. "-",
  28. ],
  29. "rendering": [
  30. "Lists",
  31. "Bidirectional",
  32. ],
  33. "domInterface": "HTMLOListElement",
  34. "contentAttributes": {
  35. "reversed": "リストが降順",
  36. "start": "マーカーの開始値",
  37. "type": "マーカーの種類",
  38. },
  39. "reference": [
  40. {
  41. "title": "HTML Living Standard. 4.4.5 The ol element. Last Updated 29 August 2025",
  42. "href": "https://html.spec.whatwg.org/multipage/grouping-content.html#the-ol-element",
  43. "heading": "HTML Living Standard. 4.4.5 The ol element",
  44. "sub": "最終更新日 2025年8月29日",
  45. },
  46. {
  47. "title": "HTML Living Standard. 15 Rendering 15.3.7 Lists. Last Updated 29 August 2025",
  48. "href": "https://html.spec.whatwg.org/multipage/rendering.html#lists",
  49. "heading": "HTML Living Standard. 15 Rendering 15.3.7 Lists",
  50. "sub": "最終更新日 2025年8月29日",
  51. },
  52. {
  53. "title": "HTML 5.3 W3C Working Draft. 4.4.6 The ol element. W3C First Public Working Draft, 14 December 2017",
  54. "href": "https://www.w3.org/TR/2017/WD-html53-20171214/grouping-content.html#the-ol-element",
  55. "heading": "HTML 5.3 W3C 初公開ワーキングドラフト. 4.4.6 The ol element",
  56. "sub": "W3Cワーキングドラフト、2017年12月14日",
  57. },
  58. {
  59. "title": "HTML 5.3 W3C Working Draft. 10.3.8. Lists. W3C First Public Working Draft, 14 December 2017",
  60. "href": "https://www.w3.org/TR/2017/WD-html53-20171214/rendering.html#section-lists",
  61. "heading": "HTML 5.3 W3C 初公開ワーキングドラフト. 10. Rendering 10.3.8. Lists",
  62. "sub": "W3Cワーキングドラフト、2017年12月14日",
  63. },
  64. {
  65. "title": "HTML 5.2 W3C Recommendation. 4.4.6 The ol element. W3C Recommendation, 14 December 2017.",
  66. "href": "https://www.w3.org/TR/2017/REC-html52-20171214/grouping-content.html#the-ol-element",
  67. "heading": "HTML 5.2 W3C 勧告. 4.4.6 The ol element",
  68. "sub": "W3C勧告、2017年12月14日",
  69. },
  70. {
  71. "title": "HTML 5.2 W3C Recommendation. 10.3.8. Lists.",
  72. "href": "https://www.w3.org/TR/2017/REC-html52-20171214/rendering.html#section-lists",
  73. "heading": "HTML 5.2 W3C 勧告. 10.3.8. Lists",
  74. "sub": "W3C勧告、2017年12月14日",
  75. },
  76. {
  77. "title": "HTML 5.1 W3C Recommendation. 4.4.5 The ol element. W3C Recommendation, 1 November 2016.",
  78. "href": "https://www.w3.org/TR/2016/REC-html51-20161101/grouping-content.html#the-ol-element",
  79. "heading": "HTML 5.1 W3C 勧告. 4.4.5 The ol element",
  80. "sub": "W3C勧告、2016年11月1日",
  81. },
  82. {
  83. "title": "HTML 5.1 W3C Recommendation. 10.3.8. Lists. W3C Recommendation, 1 November 2016.",
  84. "href": "https://www.w3.org/TR/2016/REC-html51-20161101/rendering.html#section-lists",
  85. "heading": "HTML 5.1 W3C 勧告. 10.3.8. Lists",
  86. "sub": "W3C勧告、2016年11月1日",
  87. },
  88. {
  89. "title": "HTML 5 W3C Recommendation. 4.4.5 The ol element. W3C Recommendation, 28 October 2014.",
  90. "href": "https://www.w3.org/TR/2014/REC-html5-20141028/grouping-content.html#the-ol-element",
  91. "heading": "HTML 5 W3C 勧告. 4.4.5 The ol element",
  92. "sub": "W3C勧告、2014年10月28日",
  93. },
  94. {
  95. "title": "HTML 5 W3C Recommendation. 10.3.8 Lists. W3C Recommendation, 28 October 2014.",
  96. "href": "https://www.w3.org/TR/2014/REC-html5-20141028/rendering.html#lists",
  97. "heading": "HTML 5 W3C 勧告. 10.3.8 Lists",
  98. "sub": "W3C勧告、2014年10月28日",
  99. },
  100. {
  101. "title": "HTML 4.01 Specification W3C Recommendation. 10.2 Unordered lists (UL), ordered lists (OL), and list items (LI). W3C Recommendation 24 December 1999.",
  102. "href": "https://www.w3.org/TR/html401/struct/lists.html#h-10.2",
  103. "heading": "HTML 4.01 Specification W3C 勧告. 10.2 Unordered lists (UL), ordered lists (OL), and list items (LI)",
  104. "sub": "W3C勧告1999年12月24日",
  105. },
  106. {
  107. "title": "HTML 3.2 Reference Specification. W3C Recommendation 14-Jan-1997.",
  108. "href": "https://www.w3.org/TR/2018/SPSD-html32-20180315/",
  109. "heading": "HTML 3.2 Reference Specification",
  110. "sub": "W3C勧告1997年1月14日",
  111. },
  112. {
  113. "title": "Hypertext Markup Language - 2.0. November 1995.",
  114. "href": "https://www.ietf.org/rfc/rfc1866.txt",
  115. "heading": "Hypertext Markup Language - 2.0",
  116. "sub": "November 1995",
  117. },
  118. {
  119. "title": "Hypertext Markup Language (HTML). June 1993.",
  120. "href": "https://www.w3.org/MarkUp/draft-ietf-iiir-html-01.txt",
  121. "heading": "Hypertext Markup Language (HTML)",
  122. "sub": "June 1993",
  123. },
  124. {
  125. "title": "MDN Web Docs. HTML <ol>: The Ordered List element.",
  126. "href": "https://developer.mozilla.org/ja/docs/Web/HTML/Element/ol",
  127. "heading": "<ol>: 順序付きリスト要素 - HTML: ハイパーテキストマークアップ言語 | MDN",
  128. },
  129. ],
  130. "version": {
  131. "first": "HTML",
  132. "latest": "HTML Living Standard",
  133. },
  134. "lastReviewed": "2025-08-31",
  135. "obsoleteAttributes": [
  136. "compact",
  137. ],
  138. }
  139. }

注意: 簡易に描画する為に、各項目の後ろに , を付与しています。JSON の形式では、末尾の項目の後には , は付けません。

最終確認日

2025-08-31


2.使用できるコンテキスト

ol要素は、
フローコンテンツを
受け入れる要素に
使用できます。

<ol>要素が使用できるコンテキスト(Context文脈)は、フローコンテンツを受け入れる要素コンテンツとしてです。

body
ol
  1. <body>
  2. <ol>
  3. <li>項目1</li>
  4. <li>項目2</li>
  5. </ol>
  6. </body>

<body>要素のコンテンツの一部として、フローコンテンツである<ol>要素を配置している例です。


3.コンテンツモデル

ol要素は、
li要素を
配置できます。

<ol>要素子や子孫としてどのようなコンテンツ(Content内容) が含まれなければならないかというと、0 以上の<li>要素およびスクリプトをサポートする要素です。

スクリプトをサポートする要素に分類される要素は、以下の各要素です。

ol
li
Flow
content
  1. <ol>
  2. <li><p>項目1</p></li>
  3. <li><p>項目2</p></li>
  4. </ol>

<ol>要素のコンテンツの一部として、<li>要素を配置している例です。


4.コンテンツ属性

ol要素は、
グローバル属性と、
reversed属性,
start属性,
type属性 を
配置できます。

<ol>要素に指定することができる属性は、グローバル属性reversed属性, start属性, type属性 です。

reversed属性

  1. <ol id="JOL401">
  2. <li>リスト1</li>
  3. <li>リスト2</li>
  4. <li>リスト3</li>
  5. </ol>

reversed属性 はブール属性で、存在する場合、リストが降順リストであることを示します。属性を省略した場合、リストは昇順リストになります。

  1. リスト1
  2. リスト2
  3. リスト3

start属性

  1. <ol start="" id="JOL402">
  2. <li>リスト1</li>
  3. <li>リスト2</li>
  4. <li>リスト3</li>
  5. </ol>

start属性 は、リストの開始値を決定するために使用されます。

  1. リスト1
  2. リスト2
  3. リスト3

type属性

  1. <ol type="" id="JOL403">
  2. <li>リスト1</li>
  3. <li>リスト2</li>
  4. <li>リスト3</li>
  5. </ol>

type属性 は、リスト内で使用するマーカーの種類を指定するために使用できます。

  1. リスト1
  2. リスト2
  3. リスト3

5.DOM インターフェイス

ol要素を、
直接表す
プロパティは
ありません。

<ol>要素を JavaScript などで操作するには、documentgetElementById()メソッドを用いてid属性で指定して、<ol>要素を取得する方法があります。この時に取得できる値の形式はHTMLOListElement インターフェイスです。

他には、documentquerySelectorAll()メソッドを用いて要素セレクタolと指定して用いるとか、name属性があればdocumentgetElementsByName()メソッドを用いるとか、状況, 目的によりいろいろあります。

この例示の文字の色は、です。
  1. ol要素の文字の色
  2. ol要素の文字の色
  1. <form>
  2. この例示の文字の色は、<select onchange="document.getElementById('JOL501').style.color = this.value;">
  3. <option value="inherit">継承する</option>
  4. <option value="red"></option>
  5. <option value="blue"></option>
  6. </select>です。
  7. </form>
  8. <ol id="JOL501">
  9. <li>ol要素の文字の色</li>
  10. <li>ol要素の文字の色</li>
  11. </ol>

<ol>要素id属性を指定して、そのid属性で要素を取得する例です。例示では、cssのcolorを選択して設定する処理としています。例示で動的に表示する為に、フォームの内容が変更された時に処理するコードとしています。


6.アクセシビリティ

ol要素の
暗黙的な
ARIAセマンティクスは
list role
(リスト項目要素を
含むセクション。)
です。

<ol>要素暗黙的なARIAセマンティクスは、role="list" です。
list role は、「リスト項目要素を含むセクション。」です。

リストには、listitem role を持つ子要素が含まれます。

作成者が<ol>要素に明示的に指定可能なARIA ロール(役割)は、group, listbox, menu, menubar, none, presentation, radiogroup, tablist, toolbar, tree です。

ARIA の状態プロパティについては、すべての要素で使用できるグローバル aria-* 属性に加えて、上記のロールに応じて使用可能なaria-* 属性が許可されます。

著者は非推奨のdirectoryロールを使用しないでください。


7.レンダリング

  1. ol {
  2. display: block;
  3. margin-block: 1em;
  4. padding-inline-start: 40px;
  5. counter-reset: list-item;
  6. list-style-type: decimal;
  7. unicode-bidi: isolate;
  8. }

<ol>要素ユーザーエージェントレベルスタイルシートデフォルトでは、displayプロパティの値は block であり、ブロックレベルブロックコンテナボックス(ブロックボックス) を生成します。

ブロックフォーマットコンテキストに参加して、ブロックフォーマットコンテキストを継承, 確立します。もし、インラインフォーマットコンテキストに参加するコンテンツのみを含む場合は、新しいインラインフォーマットコンテキストを確立します。次に、すべてのインラインコンテンツをラップするルートインラインボックスも生成します。

list-style-type は、リスト項目要素のマーカーを設定します。decimal は、数値です。1 から始まります。

unicode-bidi は、置換されない要素のレンダリングでの Bidirectional text(双方向テキスト) に於いての期待される仕様の様です。

  1. :is(dir, dl, menu, ol, ul) ol { margin-block: 0; }
  2. ol[type='1'] { list-style-type: decimal; }
  3. ol[type=a s] { list-style-type: lower-alpha; }
  4. ol[type=A s] { list-style-type: upper-alpha; }
  5. ol[type=i s] { list-style-type: lower-roman; }
  6. ol[type=I s] { list-style-type: upper-roman; }

<ol>要素のレンダリングに関する部分を抜粋したものです。<ol>要素が関わる他の要素のレンダリングに関する部分は省いています。

body要素ブロックフォーマット
コンテキスト
ol要素ブロック
フォーマット
コンテキスト
(継続)
li要素コンテンツ
  1. <body>
  2. <ol>
  3. <li>ブロックレベルのボックスのみの例。</li>
  4. <li>ブロックレベルのボックスのみの例。</li>
  5. </ol>
  6. </body>

<body>要素が存在して、その中に<ol>要素が存在して、その中に<li>要素がある例です。

<body>要素は、ブロックレベルブロックコンテナであるボックスを生成します。<body>要素ブロックフォーマットコンテキストに配置される為、ブロックフォーマットコンテキストを継承します。<body>要素は、ブロックレベルボックスを生成する<ol>要素などを配置します。

<ol>要素は、ブロックコンテナボックスを生成します。<li>要素は、ブロックレベルボックスを生成します。この例ではブロックレベルボックスを生成する要素だけを配置しています。なので、ブロックフォーマットコンテキストを継続します。

尚、この説明は各要素のレンダリングに関する指定が既定値での話で、個々にスタイルを指定した場合はこの限りではありません。

body要素ブロックフォーマット
コンテキスト
ol要素インライン
フォーマット
コンテキスト
ルート
インライン
ボックス
li要素コンテンツ
(インラインボックス)
  1. <body>
  2. <h1>インライン</h1>
  3. <ol>
  4. <li style="display: inline;">インラインレベルのボックスのみの例。</li>
  5. <li style="display: inline;">インラインレベルのボックスのみの例。</li>
  6. </ol>
  7. </body>

<body>要素が存在して、その中に<ol>要素が存在して、その中にスタイルシートでインラインボックスと指定した<li>要素がある例です。

<body>要素は、ブロックレベルブロックコンテナであるボックスを生成します。<body>要素ブロックフォーマットコンテキストに配置される為、ブロックフォーマットコンテキストを継承します。<body>要素は、ブロックレベルボックスを生成する<ol>要素などを配置します。

<ol>要素は、ブロックコンテナボックスを生成します。スタイルシートでインラインボックスと指定した<li>要素は、インラインレベルボックスを生成します。この例ではインラインレベルボックスを生成する要素だけを配置しています。なので、インラインフォーマットコンテキストを新たに確立します。次に、その要素は、すべてのインラインコンテンツを包むルートインラインボックスも生成します。

尚、この説明は<li>要素以外の各要素のレンダリングに関する指定が既定値での話で、個々にスタイルを指定した場合はこの限りではありません。

  1. <ol style="list-style-type: ;" id="JOL701">
  2. <li>リスト1</li>
  3. <li>リスト2</li>
  4. <li>リスト3</li>
  5. </ol>

list-style-typeプロパティはリスト項目要素のマーカーを設定します。ここでの提示は、数値カウンタシステムの一部です。type属性の機能をスタイルシートに置き換える事が出来ます。ただしユーザーがスタイルシートを無効にした場合に装飾が無効になるので、その辺を意識する場合は属性を用いた方が良いです。

  1. リスト1
  2. リスト2
  3. リスト3
  1. <div class="sdvSample702" id="JOL702">
  2. <p>リスト1</p>
  3. <p id="JPG704">リスト2</p>
  4. <p id="JPG705">リスト3</p>
  5. </div>
  1. .sdvSample702 { counter-reset: ndvDemo702 ; }
  2. .sdvSample702 > *:first-child ~ * { counter-increment: ndvDemo702 ; }
  3. .sdvSample702 > *:before { content: counter(ndvDemo702, ) '.'; position: absolute; width: 2.2em; left: -2.5em; text-align: right; }
  4. .sdvSample702 > * { position: relative; margin: 0; }

スタイルシートをstyle属性ではなく<style>要素などを用いてセレクタで指定する事によって、疑似要素などを用いた例です。

レンダリングの例示なので、<div>要素, <p>要素で提示していますが、<ol>要素, <li>要素でも<ul>要素, <li>要素でも、このスタイルシートは適用できます。というか、その為に要素セレクタは使わないで記述しています。逆に不要なプロパティもありますが、汎用性を意識した例示です。

尚、例示で動的に表現する為に、Javascript でスタイルシートを操作していますが、疑似要素の関係で用意したセレクタを選択する方法で動作させています。

リスト1

リスト2

リスト3

  1. <ol class="solSample703">
  2. <li>リスト1</li>
  3. <li>リスト2</li>
  4. <li>リスト3</li>
  5. </ol>
  1. .solSample703 { list-style-type: none; }
  2. .solSample703 > * { position: relative; }
  3. .solSample703 > *:before { position: absolute; left: -2.5em; content: counter(list-item); display: table-cell; vertical-align: middle; text-align: center; width: 1.8em; border-radius: 50%; background: #F6A38B; }

マーカーの装飾例です。list-style-typeプロパティnone を指定して、改めて疑似要素でマーカーを表しています。 カウンタを list-item そのまま使用した例示です。

  1. リスト1
  2. リスト2
  3. リスト3
  1. <ol class="solSample704">
  2. <li>リスト1</li>
  3. <li>リスト2</li>
  4. <li>リスト3</li>
  5. </ol>
  1. .solSample704 { padding: 0 0.5em 0 0; list-style-type: none; }
  2. .solSample704 > * { position: relative; margin-bottom: 5px; padding: 0.5em 0.5em 0.5em 0.5em; line-height: 1.5; vertical-align: middle; border-right: solid 2px #dadada; border-bottom: solid 2px #dadada; border-radius: 15px 0px 0px 15px; color: #505050; background: #dbebf8; }
  3. .solSample704 > *:before { display: inline-block; vertical-align: middle; text-align: center; content: counter(list-item); width: 1em; height: 1em; margin-right: 8px; padding-bottom: 8px; border-radius: 50%; background: #fff; }
  4. .solSample704 > *:hover { background: #9999ff; box-shadow: 0.25em 0.25em 0.25em 0.05em #fcf; }
  5. .solSample704 > *:hover:before { background: #F6A38B; }

そのままコピペで使えるというより、いろいろ盛り込んで提示してアレンジする前提としています。

  1. リスト1
  2. リスト2
  3. リスト3

8.気を付ける点

順序

順序に意味のある項目の一覧を表しているので、単なる番号付けとは違います。<ol>要素<ul>要素の使い分けが微妙な場合もあるので、順序の意味は意識しましょう。

マーカーの領域

マーカーは一覧に表される項目に付けられます。既定値ではボックスの外に配置されます。マーカーの領域も事前に配慮する必要があります。

項目の一覧

項目の一覧を表しているので、大きなグループなど規模についても考慮が必要かと思います。区分(セクション)などは、順序に意味があってもまとまりが少々大きいかと思います。区分(セクション)の目次などは適切かと思います。
区分(セクション)を開閉式にして一覧できる状態にするという方法もあるので、一概に可否は問えない気を付けるべき事だと思います。