w3-video.com logo

HTML5 Tutorial

Home HTML5 XAMPP .htaccess Firefox Notepad++

Share it



details nested within elements, elements nested within details

Classified as: flow content, sectioning root, interactive content, palpable content

Parents, details

Children, details

Examples: details parents, details children

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

<details>

</details>

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

<details>
<summary>...</summary>
...
</details>

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

<h1>
<details>
...
</details>
</h1>

</body>
</html>

Syntax 1: Valid, details nested within body: allowed
Syntax 2: Valid, summary nested within details, as first child: allowed and required
Syntax 3: Invalid, details nested within head, h1: not allowed

details intro details browser display details syntaxdetails open attribute