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

dl要素


1.仕様

DL要素は、
関連付けをした
項目の一覧を
表します。

DL - - ((dt+,dd+)|div)* +(%Scriptsupporting) -- definition list. (Normal elements.) [Flow|Palpablelimited] --

dl

定義一覧 (definition list)

種類

通常要素

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

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

コンテンツモデル
  • 1つ以上の<dt>要素とそれに続く1つ以上の<dd>要素の組み合わせを0個以上 オプションでスクリプトをサポートする要素が混在
  • 1つ以上の<div>要素 オプションでスクリプトをサポートする要素が混在

1つ以上の<dt>要素とそれに続く1つ以上の<dd>要素の組み合わせを0個以上が配置できます。オプションで、スクリプトをサポートする要素を混在して配置できます。
1つ以上の<div>要素が配置できます。オプションで、スクリプトをサポートする要素を混在して配置できます。

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

この時のdiv要素のコンテンツモデルは、'div (dt+,dd+) +(%Scriptsupporting)' となります。

タグの省略

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

コンテンツ属性

グローバル属性のみ

DOM インターフェイス
HTMLDListElement
  1. [Exposed=Window]
  2. interface HTMLDListElement : HTMLElement {
  3. lastReviewed;
  4. [HTMLConstructor] constructor();
  5.  
  6. // also has obsolete members
  7. };
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
暗黙的="No" ARIAロール="あり" aria-* 属性="GlobalAny"

暗黙的な ARIAセマンティクスがありませんが、意味はあり、この意味は、ARIA によって提供されず、ARIA のユーザーに公開されていないロール、状態、プロパティで表現される可能性があります。

作成者が要素に指定してもよい ARIAロール値は、 group, list, none, presentation です。

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

レンダリング
ブロックボックス
リスト
  1. dl {
  2. display: block;
  3. margin-block: 1em;
  4. unicode-bidi: isolate;
  5. }
  6. :is(dir, dl, menu, ol, ul) dl {
  7. margin-block: 0;
  8. }

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

説明
dl要素は、関連付け一覧を表します。

dl要素は、定義用語とその説明を関連付けした一覧(リスト・list)を表します。
名前と値のグループは、用語と定義, メタデータのトピックと値, 質問と回答, またはその他の名前と値のデータのグループです。HTML Living Standard での例示で、 1 つのグループに 2 つのメタデータラベルと 2 つの値がある例があるので、n 対 m の関係付けが可能な様です。

  1. <!DOCTYPE html>
  2. <html lang="ja">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>dl要素の例 - (Example of dl 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>dl要素の例</h1>
  11. <dl>
  12. <div>
  13. <dt>用語</dt>
  14. <dd>説明</dd>
  15. </div>
  16. </dl>
  17. </body>
  18. </html>

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

参照元
参照元
JSONデータ
JSON形式での、データのイメージです。
  1. {
  2. "dl": {
  3. "group": "Lists",
  4. "element": "- - ((dt+,dd+)|div)* +(%Scriptsupporting) -- definition list. (Normal elements.) [Flow|Palpablelimited] --",
  5. "attlist": {"%Global;": ""},
  6. "summary": "定義一覧 (definition list)",
  7. "point": "関連付け一覧を表します。",
  8. "description": [
  9. "定義用語とその説明を関連付けした一覧(リスト・list)を表します。",
  10. "名前と値のグループは、用語と定義, メタデータのトピックと値, 質問と回答, またはその他の名前と値のデータのグループです。HTML Living Standard での例示で、 1 つのグループに 2 つのメタデータラベルと 2 つの値がある例があるので、n 対 m の関係付けが可能な様です。",
  11. ],
  12. "elementKind": "Normal",
  13. "categories": [
  14. "Flow",
  15. "Palpablelimited",
  16. ],
  17. "categoriessupplement": "要素の子に少なくとも1つの dt要素, dd要素のグループが含まれる場合は、パルパブルコンテンツ。",
  18. "canUsedContexts": "parent (%Flow)*",
  19. "contentModel": [
  20. "dl (dt+,dd+)* +(%Scriptsupporting)",
  21. "dl (div)+ +(%Scriptsupporting)",
  22. ],
  23. "contentmodelsupplement": "この時のdiv要素のコンテンツモデルは、'div (dt+,dd+) +(%Scriptsupporting)' となります。",
  24. "tagOmission": [
  25. "-",
  26. "-",
  27. ],
  28. "rendering": [
  29. "Lists",
  30. "Bidirectional",
  31. ],
  32. "domInterface": "HTMLDListElement",
  33. "contentAttributes": "Global",
  34. "reference": [
  35. {
  36. "title": "HTML Living Standard. 4.4.9 The dl element. Last Updated 29 August 2025",
  37. "href": "https://html.spec.whatwg.org/multipage/grouping-content.html#the-dl-element",
  38. "heading": "HTML Living Standard. 4.4.9 The dl element",
  39. "sub": "最終更新日 2025年8月29日",
  40. },
  41. {
  42. "title": "HTML Living Standard. 15 Rendering 15.3.7 Lists. Last Updated 29 August 2025",
  43. "href": "https://html.spec.whatwg.org/multipage/rendering.html#lists",
  44. "heading": "HTML Living Standard. 15 Rendering 15.3.7 Lists",
  45. "sub": "最終更新日 2025年8月29日",
  46. },
  47. {
  48. "title": "HTML 5.3 W3C Working Draft. 4.4.9 The dl element. W3C First Public Working Draft, 14 December 2017",
  49. "href": "https://www.w3.org/TR/2017/WD-html53-20171214/grouping-content.html#the-dl-element",
  50. "heading": "HTML 5.3 W3C 初公開ワーキングドラフト. 4.4.9 The dl element",
  51. "sub": "W3Cワーキングドラフト、2017年12月14日",
  52. },
  53. {
  54. "title": "HTML 5.3 W3C Working Draft. 10.3.8. Lists. W3C First Public Working Draft, 14 December 2017",
  55. "href": "https://www.w3.org/TR/2017/WD-html53-20171214/rendering.html#section-lists",
  56. "heading": "HTML 5.3 W3C 初公開ワーキングドラフト. 10. Rendering 10.3.8. Lists",
  57. "sub": "W3Cワーキングドラフト、2017年12月14日",
  58. },
  59. {
  60. "title": "HTML 5.2 W3C Recommendation. 4.4.9 The dl element. W3C Recommendation, 14 December 2017.",
  61. "href": "https://www.w3.org/TR/2017/REC-html52-20171214/grouping-content.html#the-dl-element",
  62. "heading": "HTML 5.2 W3C 勧告. 4.4.9 The dl element",
  63. "sub": "W3C勧告、2017年12月14日",
  64. },
  65. {
  66. "title": "HTML 5.2 W3C Recommendation. 10.3.8. Lists.",
  67. "href": "https://www.w3.org/TR/2017/REC-html52-20171214/rendering.html#section-lists",
  68. "heading": "HTML 5.2 W3C 勧告. 10.3.8. Lists",
  69. "sub": "W3C勧告、2017年12月14日",
  70. },
  71. {
  72. "title": "HTML 5.1 W3C Recommendation. 4.4.8 The dl element. W3C Recommendation, 1 November 2016.",
  73. "href": "https://www.w3.org/TR/2016/REC-html51-20161101/grouping-content.html#the-dl-element",
  74. "heading": "HTML 5.1 W3C 勧告. 4.4.8 The dl element",
  75. "sub": "W3C勧告、2016年11月1日",
  76. },
  77. {
  78. "title": "HTML 5.1 W3C Recommendation. 10.3.8. Lists. W3C Recommendation, 1 November 2016.",
  79. "href": "https://www.w3.org/TR/2016/REC-html51-20161101/rendering.html#section-lists",
  80. "heading": "HTML 5.1 W3C 勧告. 10.3.8. Lists",
  81. "sub": "W3C勧告、2016年11月1日",
  82. },
  83. {
  84. "title": "HTML 5 W3C Recommendation. 4.4.8 The dl element. W3C Recommendation, 28 October 2014.",
  85. "href": "https://www.w3.org/TR/2014/REC-html5-20141028/grouping-content.html#the-dl-element",
  86. "heading": "HTML 5 W3C 勧告. 4.4.8 The dl element",
  87. "sub": "W3C勧告、2014年10月28日",
  88. },
  89. {
  90. "title": "HTML 5 W3C Recommendation. 10.3.8 Lists. W3C Recommendation, 28 October 2014.",
  91. "href": "https://www.w3.org/TR/2014/REC-html5-20141028/rendering.html#lists",
  92. "heading": "HTML 5 W3C 勧告. 10.3.8 Lists",
  93. "sub": "W3C勧告、2014年10月28日",
  94. },
  95. {
  96. "title": "HTML 4.01 Specification W3C Recommendation. 10.3 Definition lists: the DL, DT, and DD elements. W3C Recommendation 24 December 1999.",
  97. "href": "https://www.w3.org/TR/html401/struct/lists.html#h-10.3",
  98. "heading": "HTML 4.01 Specification W3C 勧告. 10.3 Definition lists: the DL, DT, and DD elements",
  99. "sub": "W3C勧告1999年12月24日",
  100. },
  101. {
  102. "title": "HTML 3.2 Reference Specification. W3C Recommendation 14-Jan-1997.",
  103. "href": "https://www.w3.org/TR/2018/SPSD-html32-20180315/",
  104. "heading": "HTML 3.2 Reference Specification",
  105. "sub": "W3C勧告1997年1月14日",
  106. },
  107. {
  108. "title": "Hypertext Markup Language - 2.0. November 1995.",
  109. "href": "https://www.ietf.org/rfc/rfc1866.txt",
  110. "heading": "Hypertext Markup Language - 2.0",
  111. "sub": "November 1995",
  112. },
  113. {
  114. "title": "Hypertext Markup Language (HTML). June 1993.",
  115. "href": "https://www.w3.org/MarkUp/draft-ietf-iiir-html-01.txt",
  116. "heading": "Hypertext Markup Language (HTML)",
  117. "sub": "June 1993",
  118. },
  119. {
  120. "title": "MDN Web Docs. HTML <dl>: The Description List element.",
  121. "href": "https://developer.mozilla.org/ja/docs/Web/HTML/Element/dl",
  122. "heading": "<dl>: 説明リスト要素 - HTML: ハイパーテキストマークアップ言語 | MDN",
  123. },
  124. ],
  125. "version": {
  126. "first": "HTML",
  127. "latest": "HTML Living Standard",
  128. },
  129. "lastReviewed": "2025-08-31",
  130. "heed": [
  131. "コンテンツモデルにあるグループをまとめる div要素は、HTML5.2, HTML Living Standard で採用された機能です。",
  132. ],
  133. "obsoleteAttributes": [
  134. "compact",
  135. ],
  136. }
  137. }

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

最終確認日

2025-08-31


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

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

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

body
dl
  1. <body>
  2. <dl>
  3. <div>
  4. <dt>テーマ1</dt>
  5. <dd>説明1</dd>
  6. </div>
  7. <div>
  8. <dt>テーマ2</dt>
  9. <dd>説明2</dd>
  10. </div>
  11. </dl>
  12. </body>

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


3.コンテンツモデル

dl要素は、
dt要素,
dd要素を
配置できます。

<dl>要素子や子孫としてどのようなコンテンツ(Content内容) が含まれなければならないかというと、0 以上の<dt>要素, <dd>要素の組み合わせ、およびスクリプトをサポートする要素です。
この組み合わせは、<div>要素でラップ出来ます。

別の言い方で何が配置できるかというと、<dt>要素, <dd>要素の組み合わせ、またはそれらをラップした<div>要素と、オプションのスクリプトをサポートする要素が配置できます。

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

dl
dt
dd
Flow
content
Flow
content
  1. <dl>
  2. <dt>テーマ1</dt>
  3. <dd>説明1</dd>
  4. <dt>テーマ2</dt>
  5. <dd>説明2</dd>
  6. </dl>

ツリーで表すと、<dl>要素のコンテンツの一部として、<dt>要素<dd>要素が配置できます。

dl
div
dt
dd
Flow
content
Flow
content
  1. <dl>
  2. <div>
  3. <dt>テーマ1</dt>
  4. <dd>説明1</dd>
  5. </div>
  6. <div>
  7. <dt>テーマ2</dt>
  8. <dd>説明2</dd>
  9. </div>
  10. </dl>

ツリーで表すと、<dl>要素のコンテンツの一部として、<dt>要素<dd>要素をラップした<div>要素が配置できます。


4.コンテンツ属性

dl要素は、
グローバル属性のみ、
配置できます。

<dl>要素に指定することができる属性は、グローバル属性のみです。


5.DOM インターフェイス

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

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

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

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

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


6.アクセシビリティ

dl要素の
暗黙的な
ARIAセマンティクスは
ありません。

<dl>要素暗黙的なARIAセマンティクスは、ありません。
No corresponding roleマークされている要素は、ARIAの暗黙的なセマンティクスを持ちませんが、意味を持ちます。この意味は、ARIAでは提供されていないロールステートプロパティで表現され、アクセシビリティAPIを介して支援技術のユーザに公開される場合があります。したがって、リストされている要素のセマンティクスを上書きするのではなく、divやspanなどのセマンティクス的に中立な要素にロール属性を追加することをお勧めします。

作成者が<dl>要素に明示的に指定可能なARIA ロール(役割)は、group, list, none, presentation です。

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


7.レンダリング

  1. dl {
  2. display: block;
  3. margin-block: 1em;
  4. unicode-bidi: isolate;
  5. }

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

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

list-style-type は、リスト項目要素のマーカーを設定します。disc は、塗りつぶされた円形です。

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

  1. :is(dir, dl, menu, ol, ul) dl { margin-block: 0; }

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

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

<body>要素が存在して、その中に<dl>要素が存在して、その中に<dt>要素, <dd>要素がある例です。

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

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

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

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

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

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

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

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

また、このように<dt>要素, <dd>要素にインラインの指定をする場合に<div>要素を用いないと、一覧としての見た目の区別がつかなくなるので、あえて<div>要素を用いた例示としています。

  1. <dl style="padding-left: 1.5em;">
  2. <div style="display: list-item; list-style-type: decimal;">
  3. <dt>Term1</dt>
  4. <dd>Desc1</dd>
  5. </div>
  6. <div style="display: list-item; list-style-type: decimal;">
  7. <dt>Term2</dt>
  8. <dd>Desc2</dd>
  9. </div>
  10. </dl>

style属性を用いる事で、他の箇所をいじらない様にする前提での装飾例です。

Term1
Desc1
Term2
Desc2
  1. <dl class="sdlSample701">
  2. <div>
  3. <dt>Term1</dt>
  4. <dd>Desc1</dd>
  5. </div>
  6. <div>
  7. <dt>Term2</dt>
  8. <dd>Desc2</dd>
  9. </div>
  10. </dl>
  1. .sdlSample701 { padding: 0.3em; border-style: dotted; border-width: 0.0625em; border-left-style: solid; border-left-width: 0.5em; border-radius: 0.8em; color: inherit; background-color: #efffff; border-color: rgba(102, 102, 255, 0.6); }
  2. .sdlSample701 > div { margin: 0 0 0.5em 0; padding: 0.5em; border-style: dotted; border-width: 0.0625em; border-radius: 0.8em; color: inherit; border-color: rgba(102, 102, 255, 0.6); }
  3. .sdlSample701 > div:last-child { margin-bottom: 0; }
  4. .sdlSample701 dt { font-weight: bold; }

ここのページの「仕様」で用いているスタイルシートの記述例です。

Term1
Desc1
Term2
Desc2
  1. <dl class="sdlSample702">
  2. <div>
  3. <dt>Term1</dt>
  4. <dd>Description1</dd>
  5. </div>
  6. <div>
  7. <dt>Term2</dt>
  8. <dd>Description2</dd>
  9. </div>
  10. </dl>
  1. .sdlSample702 > div { margin: 0 0 1.0em 0; }
  2. .sdlSample702 dt { display: inline-block; margin: 0 0.5em 1em 0; padding: 0.2em 0.3em 0.1em 1.7em; border-style: double; border-width: 0.3em 0; min-width: auto; text-indent: -1.5em; white-space: nowrap; word-wrap: normal; word-break: keep-all; font: bold 1.17em/1.2 'Noto Sans JP', serif; color: inherit; background-color: #fff; border-color: #99f; box-shadow: 0.25em 0.25em 0.25em 0.05em #fcf; }
  3. .sdlSample702 dd { margin: 0; }

このサイトの「小見出し」で用いているスタイルシートの記述例です。

Term1
Description1
Term2
Description2

8.気を付ける点

要素の
装飾と選択は、
別々に考えましょう。

装飾を理由とした要素の選択は止めましょう。

  1. <div class="sdvSample801">
  2. <dl>
  3. <dt>DFN要素</dt>
  4. <dd>用語の定義インスタンスを表します。</dd>
  5. </dl>
  6. <p>
  7. <dfn>DFN要素</dfn><span>とは、</span>
  8. <span>用語の定義インスタンスを表します。</span>
  9. </p>
  10. </div>
  1. .sdvSample801 dfn { display: block; }
  2. .sdvSample801 dfn + span { display: none; }
  3. .sdvSample801 span { display: block; margin-left: 40px; }

<dt>要素, <dd>要素<dfn>要素, <span>要素に置き換えて装飾を CSS で行えば、ほぼ同じです。

DFN要素
用語の定義インスタンスを表します。

DFN要素とは、 用語の定義インスタンスを表します。

  1. <div class="sdvSample802">
  2. <dl>
  3. <dt>DFN要素</dt>
  4. <dd>用語の定義インスタンスを表します。</dd>
  5. </dl>
  6. <p>
  7. <dfn>DFN要素</dfn><span>とは、</span>
  8. <span>用語の定義インスタンスを表します。</span>
  9. </p>
  10. </div>
  1. .sdvSample802 dt { display: inline; }
  2. .sdvSample802 dt::after { content: 'とは、'; }
  3. .sdvSample802 dd { display: inline; margin: 0; }

<dt>要素, <dd>要素の装飾を CSS で行えば <dfn>要素とほぼ同じにできます。

DFN要素
用語の定義インスタンスを表します。

DFN要素とは、 用語の定義インスタンスを表します。

  1. <div class="sdvSample803">
  2. <dl>
  3. <div>
  4. <dt>DFN要素</dt>
  5. <dd>用語の定義インスタンスを表します。</dd>
  6. </div>
  7. <div>
  8. <dt>DL要素</dt>
  9. <dd>関連付け一覧を表します。</dd>
  10. </div>
  11. </dl>
  12. </div>
  1. .sdvSample803 dl { display: table; }
  2. .sdvSample803 div { display: table-row; }
  3. .sdvSample803 dt, .sdvSample803 dd { display: table-cell; margin: 0; padding: 2px; border: solid 1px blue; vertical-align: middle; }
  4. .sdvSample803 dd { font-weight: bold; }

<dl>要素, <dt>要素, <dd>要素の装飾を CSS で行う事で、<table>要素とほぼ同じにできます。ただし、列にあたる要素の数に注意が必要です。

DFN要素
用語の定義インスタンスを表します。
DL要素
関連付け一覧を表します。