w3-video.com logo

HTML5 Tutorial

Home HTML5 XAMPP .htaccess Firefox Notepad++

Share it



dl nested within elements, elements nested within dl

Classified as: flow content, palpable content (if dt-dd children present)

Parents, dl

Children, dl

Examples: dl parents, dl children

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

<dl> ...</dl>

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

<dl>
<dt> ...</dt>
<dd> ...</dd>
<dt> ...</dt>
<dd> ...</dd>
<dd> ...</dd>
<dd> ...</dd>
</dl>

</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>
<dl>...</dl>
</head>
<body>

<h1>
<dl>
<p>...</p>
<h1>...</h1>
<a>...</a>
</dl>
</h1>

</body>
</html>

Syntax 1: Valid, dl nested within body: allowed
Syntax 2: Valid, only dt, dd elements nested inside dl: (the 1stdt has 1 corresponding dd, the 2nddt has 3 corresponding dd elements): allowed
Syntax 3: Invalid,
dl nested within head, h1: not allowed;
different (p, h1, a) html elements other than dt, dd nested within dl: not allowed

dl intro dl browser display dl syntax