回答編集履歴

3

他の回答へのリンクが切れていたため、修正。

2018/06/15 12:02

投稿

sounisi5011
sounisi5011

スコア697

test CHANGED
@@ -56,4 +56,4 @@
56
56
 
57
57
 
58
58
 
59
- [coba-cobaさんの解答](https://teratail.com/questions/25115#r39516)のような修正を行う必要があります。
59
+ [coba-cobaさんの解答](https://teratail.com/questions/25115#reply-39516)のような修正を行う必要があります。

2

仕様書を確認したところ、script要素とtemplate要素もol要素の子要素にできるようなので、仕様書の引用と共に追記。

2018/06/15 12:02

投稿

sounisi5011
sounisi5011

スコア697

test CHANGED
@@ -1,14 +1,42 @@
1
- そもそも、ol要素の直下の要素(子要素)にはli要素しか指定できません。
1
+ そもそも、ol要素の直下の要素(子要素)にはli要素、script要素、template要素しか指定できません。
2
2
 
3
3
 
4
4
 
5
- [ol 要素 - HTML | MDN](https://developer.mozilla.org/ja/docs/Web/HTML/Element/ol)
5
+ [4.4.5 The ol element - HTML Standard](https://html.spec.whatwg.org/multipage/grouping-content.html#the-ol-element)
6
6
 
7
7
 
8
8
 
9
- > 許可された内容
9
+ > [Content model](https://html.spec.whatwg.org/multipage/dom.html#concept-element-content-model):
10
10
 
11
- > 0 個以上の [<li>](https://developer.mozilla.org/ja/docs/Web/HTML/Element/li) 要素
11
+ > Zero or more [li](https://html.spec.whatwg.org/multipage/grouping-content.html#the-li-element) and [script-supporting](https://html.spec.whatwg.org/multipage/dom.html#script-supporting-elements-2) elements.
12
+
13
+
14
+
15
+ > 訳:0個以上の、[li要素](https://html.spec.whatwg.org/multipage/grouping-content.html#the-li-element)と[script-supporting](https://html.spec.whatwg.org/multipage/dom.html#script-supporting-elements-2)要素。
16
+
17
+
18
+
19
+ [4.4.5 The ol element — HTML5](https://www.w3.org/TR/html50/grouping-content.html#the-ol-element)
20
+
21
+
22
+
23
+ > [Content model](https://www.w3.org/TR/html50/dom.html#element-dfn-content-model):
24
+
25
+ > Zero or more [li](https://www.w3.org/TR/html50/grouping-content.html#the-li-element) and [script-supporting](https://www.w3.org/TR/html50/dom.html#script-supporting-elements-0) elements.
26
+
27
+
28
+
29
+ > 訳:0個以上の、[li要素](https://www.w3.org/TR/html50/grouping-content.html#the-li-element)と[script-supporting](https://www.w3.org/TR/html50/dom.html#script-supporting-elements-0)要素。
30
+
31
+
32
+
33
+ [<ol>: 順序付きリスト要素 - HTML | MDN](https://developer.mozilla.org/ja/docs/Web/HTML/Element/ol)
34
+
35
+
36
+
37
+ > 許可されている内容
38
+
39
+ > 0個以上の [`<li>`](https://developer.mozilla.org/ja/docs/Web/HTML/Element/li) 要素。さらに [`<ol>`](https://developer.mozilla.org/ja/docs/Web/HTML/Element/ol) または [`<ul>`](https://developer.mozilla.org/ja/docs/Web/HTML/Element/ul) 要素を入れ子で包含することがあります。
12
40
 
13
41
 
14
42
 

1

日本語の表現を修正

2018/06/15 12:00

投稿

sounisi5011
sounisi5011

スコア697

test CHANGED
@@ -22,9 +22,9 @@
22
22
 
23
23
  簡単に言うと、ol要素の子要素としてdiv要素を指定している現在のマークアップそのものが、つまり、HTMLのほうが誤っています。
24
24
 
25
- IEとEdge以外では正常に表示されているとしても、それは「たまたま」正常に表示されたWebブラウザのエンジンが非常に親切だったというだけのこと。
25
+ IEとEdge以外では正常に表示されているとしても、それは「たまたま」正常に表示されただけであって、そのWebブラウザのエンジンが非常に親切だったというだけのこと。
26
26
 
27
- テストされていない未知のブラウザ等でも似たような現象が起こりえますし、そうなったとしてもHTML側が間違っているため、ブラウザのバグとは言えません。
27
+ テストされていない未知のブラウザ等でも似たような、あるいはもっとひどい現象が起こりえますし、そうなったとしてもHTML側が間違っているため、ブラウザのバグとは言えません。
28
28
 
29
29
 
30
30