w3-video.com logo

HTML5 Tutorial

Home HTML5 XAMPP .htaccess Firefox Notepad++

Share it



ol nested within elements, elements nested within ol

Classified as: flow content, palpable content (if li child present)

Parents, ol

Children, ol

Examples: ol parents, ol children

Valid Syntax 1
1
2
3
4
5
6
7
8
9
10
11
<!doctype html>
<html>
<head>
<title>...</title>
</head>
<body>

<ol>...</ol>

</body>
</html>
Valid Syntax 2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<!doctype html>
<html>
<head>
<title>...</title>
</head>
<body>

<ol>
<li>...
<ol>
<li>...</li>
<li>...</li>
</ol>
</li>
<li>...</li>
</ol>

</body>
</html>
Invalid Syntax 3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<!doctype html>
<html>
<head>
<title>...</title>
<ol>...<ol>
</head>
<body>

<h1>...
<ol>
<p>...</p>
<h1>...</h1>
<a>...</a>
</ol>
</h1>

</body>
</html>

Syntax 1: Valid, ol nested within body: allowed
Syntax 2: Valid, li elements nested within ol: allowed; ol nested within li: allowed
Syntax 3: Invalid, ol nested within head, h1: not allowed; elements (p, h1, a) other than li nested within ol: not allowed

ol intro ol, optional, occurrences ol browser display ol vs ulol syntaxol reversed attributeol start attributeol type attribute