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

li要素


1.仕様

LI要素は、
一覧とした項目を
表します。

li

一覧項目 (list item)

種類

通常要素

カテゴリ

なし

使用できるコンテキスト
  • ul要素に 0個以上
  • ol要素に 0個以上
  • menu要素に 0個以上

ul要素に 0個以上を そのコンテンツとして、使用できます。
ol要素に 0個以上を そのコンテンツとして、使用できます。
menu要素に 0個以上を そのコンテンツとして、使用できます。

HTML5 で廃止された要素ですが、dir要素にも使用できます。

タグの省略
終了タグは省略できます。

li要素の直後に別の li要素が続く場合、または親要素にコンテンツがない場合は、li要素の終了タグを省略できます。

コンテンツ属性
グローバル属性 他
value属性
リスト項目の序数値
DOM インターフェイス
HTMLLIElement
  1. [Exposed=Window]
  2. interface HTMLLIElement : HTMLElement {
  3. [HTMLConstructor] constructor();
  4.  
  5. [CEReactions] attribute long value;
  6.  
  7. // also has obsolete members
  8. };
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
暗黙的="listitem,generic" ARIAロール="No" aria-* 属性="GlobalAny"

暗黙的な ARIAセマンティクスは、role=listitem, generic です。
li要素がリスト要素 (ul、ol、menu) の子である場合、role=listitem。li要素がリスト要素の子でない場合は、role=generic

作成者は、暗黙的な ARIAセマンティクス, または HTML要素のネイティブセマンティクスを上書きしてはいけません。
親リスト要素に暗黙的または明示的なリストロールがある場合、listitem 以外のロールはありません (推奨されません)。それ以外の場合、親リスト要素が暗黙的または明示的なリストロールを公開していない場合は、任意のロールです。

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

レンダリング
ブロックボックス
リスト
  1. li {
  2. display: list-item;
  3. text-align: match-parent;
  4. unicode-bidi: isolate;
  5. }
  6. li[type="1"] { list-style-type: decimal; }
  7. li[type=a s] { list-style-type: lower-alpha; }
  8. li[type=A s] { list-style-type: upper-alpha; }
  9. li[type=i s] { list-style-type: lower-roman; }
  10. li[type=I s] { list-style-type: upper-roman; }
  11. li[type=none i] { list-style-type: none; }
  12. li[type=disc i] { list-style-type: disc; }
  13. li[type=circle i] { list-style-type: circle; }
  14. li[type=square i] { list-style-type: square; }

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

説明
li要素は、一覧項目を表します。

li要素は、項目(アイテム・item)を表します。
親要素が ol要素, ul要素, menu要素, dir要素の場合、要素はそれらの要素に対して定義されている様に、親要素のリストの項目になります。それ以外の場合、リスト項目には他の li要素とのリスト関連関係は定義されていません。
リストの項目は、ol要素, ul要素, menu要素, dir要素の li要素の子ノードで、ツリー順になっています。

  1. <!DOCTYPE html>
  2. <html lang="ja">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>li要素の例 - (Example of li element) | 離珠のHTMLでしぃ!</title>
  6. </head>
  7. <body>
  8. <h1>li要素の例</h1>
  9. <ul>
  10. <li>リストアイテムA</li>
  11. <li>リストアイテムB</li>
  12. </ul>
  13. </body>
  14. </html>

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

JSONデータ
JSON形式での、データのイメージです。
  1. {
  2. "li": {
  3. "check": "2024-09-01",
  4. "group": "List",
  5. "element": "- O (%Flow)* -- list item. (Normal elements.) [None] --",
  6. "attlist": {
  7. "%Global;": "",
  8. "value": "NUMBER #IMPLIED -- Ordinal value of the list item --",
  9. },
  10. "comment": "一覧項目 (list item)",
  11. "point": "一覧項目を表します。",
  12. "description": [
  13. "項目(アイテム・item)を表します。",
  14. "親要素が ol要素, ul要素, menu要素, dir要素の場合、要素はそれらの要素に対して定義されている様に、親要素のリストの項目になります。それ以外の場合、リスト項目には他の li要素とのリスト関連関係は定義されていません。",
  15. "リストの項目は、ol要素, ul要素, menu要素, dir要素の li要素の子ノードで、ツリー順になっています。",
  16. ],
  17. "kind": "Normal",
  18. "categories": "None",
  19. "used": [
  20. "ul li*",
  21. "ol li*",
  22. "menu li*",
  23. ],
  24. "usedsupplement": "HTML5 で廃止された要素ですが、dir要素にも使用できます。",
  25. "contentmodel": "li (%Flow)*",
  26. "tag": [
  27. "-",
  28. "O",
  29. ],
  30. "tagsupplement": "li要素の直後に別の li要素が続く場合、または親要素にコンテンツがない場合は、li要素の終了タグを省略できます。",
  31. "attributes": {"value": "リスト項目の序数値"},
  32. "dominterface": "HTMLLIElement",
  33. "rendering": [
  34. "Lists",
  35. "Bidirectional",
  36. ],
  37. "reference": [
  38. {
  39. "title": "HTML Living Standard. 4.4.8 The li element.",
  40. "href": "https://html.spec.whatwg.org/multipage/grouping-content.html#the-li-element",
  41. "heading": "HTML Living Standard. 4.4.8 The li element",
  42. "sub": "Last Updated 27 August 2024",
  43. },
  44. {
  45. "title": "HTML Living Standard. 15 Rendering 15.3.7 Lists.",
  46. "href": "https://html.spec.whatwg.org/multipage/rendering.html#lists",
  47. "heading": "HTML Living Standard. 15 Rendering 15.3.7 Lists",
  48. "sub": "Last Updated 27 August 2024",
  49. },
  50. {
  51. "title": "HTML 5.2 W3C Recommendation. 4.4.8 The li element. W3C Recommendation, 14 December 2017.",
  52. "href": "https://www.w3.org/TR/2017/REC-html52-20171214/grouping-content.html#the-li-element",
  53. "heading": "HTML 5.2 W3C 勧告. 4.4.8 The li element",
  54. "sub": "W3C勧告、2017年12月14日",
  55. },
  56. {
  57. "title": "HTML 5.2 W3C Recommendation. 10.3.8. Lists.",
  58. "href": "https://www.w3.org/TR/2017/REC-html52-20171214/rendering.html#section-lists",
  59. "heading": "HTML 5.2 W3C 勧告. 10.3.8. Lists",
  60. "sub": "W3C勧告、2017年12月14日",
  61. },
  62. {
  63. "title": "HTML 5.1 W3C Recommendation. 4.4.7 The li element. W3C Recommendation, 1 November 2016.",
  64. "href": "https://www.w3.org/TR/2016/REC-html51-20161101/grouping-content.html#the-li-element",
  65. "heading": "HTML 5.1 W3C 勧告. 4.4.7 The li element",
  66. "sub": "W3C勧告、2016年11月1日",
  67. },
  68. {
  69. "title": "HTML 5.1 W3C Recommendation. 10.3.8. Lists. W3C Recommendation, 1 November 2016.",
  70. "href": "https://www.w3.org/TR/2016/REC-html51-20161101/rendering.html#section-lists",
  71. "heading": "HTML 5.1 W3C 勧告. 10.3.8. Lists",
  72. "sub": "W3C勧告、2016年11月1日",
  73. },
  74. {
  75. "title": "HTML 4.01 Specification W3C Recommendation. 10.2 Unordered lists (UL), ordered lists (OL), and list items (LI). W3C Recommendation 24 December 1999.",
  76. "href": "https://www.w3.org/TR/html401/struct/lists.html#h-10.2",
  77. "heading": "HTML 4.01 Specification W3C 勧告. 10.2 Unordered lists (UL), ordered lists (OL), and list items (LI)",
  78. "sub": "W3C勧告1999年12月24日",
  79. },
  80. {
  81. "title": "HTML 3.2 Reference Specification. W3C Recommendation 14-Jan-1997.",
  82. "href": "https://www.w3.org/TR/2018/SPSD-html32-20180315/",
  83. "heading": "HTML 3.2 Reference Specification",
  84. "sub": "W3C勧告1997年1月14日",
  85. },
  86. {
  87. "title": "Hypertext Markup Language - 2.0. November 1995.",
  88. "href": "https://www.ietf.org/rfc/rfc1866.txt",
  89. "heading": "Hypertext Markup Language - 2.0",
  90. "sub": "November 1995",
  91. },
  92. {
  93. "title": "Hypertext Markup Language (HTML). June 1993.",
  94. "href": "https://www.w3.org/MarkUp/draft-ietf-iiir-html-01.txt",
  95. "heading": "Hypertext Markup Language (HTML)",
  96. "sub": "June 1993",
  97. },
  98. {
  99. "title": "MDN Web Docs. HTML <li>: The List Item element.",
  100. "href": "https://developer.mozilla.org/ja/docs/Web/HTML/Element/li",
  101. "heading": "<li>: リスト項目要素 - HTML: ハイパーテキストマークアップ言語 | MDN",
  102. },
  103. ],
  104. "version": {
  105. "first": "HTML",
  106. "latest": "HTML Living Standard",
  107. },
  108. "domsupplement": {"value": "long"},
  109. }
  110. }

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

最終確認日

2024-09-01


2.使用可能な箇所

ol要素,
ul要素,
menu要素,
dir要素 に
配置できます。

ol要素, ul要素, menu要素に配置できます。

HTML5 で廃止された要素ですが、dir要素にも配置できます。


3.配置できるコンテンツ

フローコンテンツ
配置できます。

li
Flow
content
  1. <ul>
  2. <li>一覧項目</li>
  3. </ul>

li要素のコンテンツとしてフローコンテンツが配置できて、そのコンテンツ自体の意味やその順序の意味の有無を親の要素によって表される訳です。

ブロック
フォーマット
コンテキスト
マーカー
ボックス
コンテンツ

ボックスで表すと、li要素が存在して、その中に疑似要素のマーカーと フローコンテンツがあります。

li要素は、ブロックレベルブロックコンテナであるボックスを生成します。li要素を含むブロックフォーマットコンテキストがない場合は、新しいブロックフォーマットコンテキストを確立します。li要素は、マーカーボックスを生成し、フローコンテンツを配置します。なのでここで インラインフォーマットコンテキストが確立されるか否かは、配置するコンテンツ次第です。
尚、この説明は各要素のレンダリングに関する指定が既定値での話で、個々にスタイルを指定した場合はこの限りではありません。

list-style-positionプロパティは、主ブロックボックスに対するマーカーボックスの位置を指定します。
outside (初期値) は、マーカーボックスは主ブロックボックスの外側にある事を示します。
inside は、マーカーボックスは、主要ブロックボックス内の最初のインラインボックスとして、要素のコンテンツの前、および :before 疑似要素の前に配置されます。


4.属性

グローバル属性と、
value を
設定できます。

li要素は、グローバル属性value属性 を設定できます。

要素が ul要素 または menu要素 または dir要素の子でない場合に、value属性 を設定できます。

value属性

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

value属性は、リスト項目の順序値を決定する為に使用されます。

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

5.Web API

親のid属性を用いて
querySelectorAll()メソッドで
要素を取得する方法がお勧めです。

li要素を表すプロパティはないので、親の id属性を用いて documentquerySelectorAll()メソッドで、要素を取得する方法がお勧めです。この時に取得できるのはNodeList オブジェクトです。

  1. <ol id="iolJs551">
  2. <li>リスト1</li>
  3. <li>リスト2</li>
  4. <li>リスト3</li>
  5. </ol>
  1. <script>
  2. document.querySelectorAll("#iolJs551 > *")[1].value = ;
  3. </script>

value属性は、リスト項目の順序値を決定する為に使用されます。

指定された CSS セレクターに一致する文書中の要素のリストを用いている例なので、1件でも配列です。
この例示では、3件で2番目(1番目が 0 で、2番目が 1 の添え字となります。)の要素を扱う処理です。

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

6.レンダリング

  1. li {
  2. display: list-item;
  3. unicode-bidi: isolate;
  4. }

li要素は、ブロックレベルのブロックコンテナであるボックスを生成します。 (マーカーの分のコンテナボックスも生成します。)

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

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

  1. li[type="1"] { list-style-type: decimal; }
  2. li[type=a s] { list-style-type: lower-alpha; }
  3. li[type=A s] { list-style-type: upper-alpha; }
  4. li[type=i s] { list-style-type: lower-roman; }
  5. li[type=I s] { list-style-type: upper-roman; }
  6. li[type=none i] { list-style-type: none; }
  7. li[type=disc i] { list-style-type: disc; }
  8. li[type=circle i] { list-style-type: circle; }
  9. li[type=square i] { list-style-type: square; }

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

属性セレクタの記述がありますが、type属性は html5 では廃止されています。装飾したい場合は、スタイルシートで指定しましょう。

  1. <ol>
  2. <li>リスト1</li>
  3. <li style="counter-set: list-item ">リスト2</li>
  4. <li>リスト3</li>
  5. </ol>

value属性の代わりに、スタイルシートで counter-setプロパティを用いた例です。value属性の代わりという事で要素の中の属性を書き換えるという考え方で style属性を用いていますが、外部ファイルとしてlink要素を, せめてstyle要素で書き換える事をお勧めします。

  1. リスト1
  2. リスト2
  3. リスト3
  1. <ul class="culSample562">
  2. <li>リスト1</li>
  3. <li>リスト2</li>
  4. <li>リスト3</li>
  5. </ul>
  1. .culSample562 {
  2. padding-left: 0;
  3. list-style-type: none;
  4. }
  5. .culSample562 > * {
  6. position: relative;
  7. margin-bottom: 5px;
  8. padding: 0.5em 0.5em 0.5em 0.5em;
  9. line-height: 1.5;
  10. vertical-align: middle;
  11. border-right: solid 2px #dadada;
  12. border-bottom: solid 2px #dadada;
  13. border-radius: 15px 0px 0px 15px;
  14. color: #505050;
  15. background: #dbebf8;
  16. }
  17. .culSample562 > *:before {
  18. display: inline-block;
  19. vertical-align: middle;
  20. content: '';
  21. width: 1em;
  22. height: 1em;
  23. margin-right: 8px;
  24. border-radius: 50%;
  25. background: #fff;
  26. }
  27. .culSample562 > *::hover {
  28. background: #9999ff;
  29. box-shadow: 0.25em 0.25em 0.25em 0.05em #fcf;
  30. }
  31. .culSample562 > *:hover:before {
  32. background: #8b6b4e;
  33. }

一覧(リスト・list)の項目(アイテム・item)を装飾する例です。 マーカーの装飾という視点でのデザインは、ol要素, ul要素のページを参照して下さい。

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

  • リスト1
  • リスト2
  • リスト3

7.気を付ける点

一覧の項目

一覧(リスト・list)の項目(アイテム・item)なので、常に親要素とその子要素(他のli要素)を意識する必要があります。個々の項目が一覧という纏まりとして適切かという点です。

CSSの継承

CSS プロパティは、既定で親要素の計算値に設定されるものとそのプロパティの初期値に設定されるものがあります。前者が継承ありで後者は継承なしと表します。
list-style-typeプロパティは継承ありなので、親の要素の計算値が既定値です。また祖先の要素で指定している物がない場合はプロパティの初期値の disc が継承されています。li要素での指定の有無だけでなく、祖先の要素の指定の有無も意識しましょう。これは、type属性にも関わって、属性値が継承されるのではなくて、属性値によって指定された CSSプロパティの値の継承で子孫にも影響するという事です。


8.付記