w3-video.com logo

HTML5 Tutorial

Home HTML5 XAMPP .htaccess Firefox Notepad++

Share it



em nested within elements, elements nested within em

Classified as: flow content, phrasing content, palpable content

Parents, em

Children, em

Examples: em parents, em 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>

<p>
<em>

</em>
</p>

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

<p>
<em>
<a>...</a>
</em>
</p>

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

<em>
<article>
...
</article>
</em>

</body>
</html>

Syntax 1: Valid, em element nested within p: allowed
Syntax 2: Valid, a nested within em: allowed
Syntax 3: Invalid, em nested within head: not allowed; article nested within em: not allowed

em intro em browser display em syntax