w3-video.com logo

HTML5 Tutorial

Home HTML5 XAMPP .htaccess Firefox Notepad++

Share it



h1 h2 h3 h4 h5 h6 nested within elements,
elements nested within h1 h2 h3 h4 h5 h6

Classified as: flow content, heading content, palpable content

Parents, h1, h2, h3, h4, h5, h6

Children, h1, h2, h3, h4, h5, h6

Examples: h1, h2, h3, h4, h5, h6 parents - children

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

<h1> ...</h1>

<hgroup>
<h1> ...</h1>
</hgroup>

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

<h1>
<a> ...</a>
</h1>

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

<p>
<h1> ...</h1>
</p>

</body>
</html>

Syntax 1: Valid, h1 nested inside body, h1 nested inside hgroup: allowed
Syntax 2: Valid, a nested inside h1: allowed
Syntax 3: Invalid, h1 nested inside head: not allowed; h1 nested inside p: not allowed

h1...h6 intro h1...h6 browser display h1...h6 outlineh1...h6 syntax