w3-video.com logo

HTML5 Tutorial

Home HTML5 XAMPP .htaccess Firefox Notepad++

Share it



col nested within elements

Classified as: -

Parents, col

Children, col

Examples: col parents, nesting col

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



</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>

<table>
<colgroup><col> <col></colgroup>
...
</table>

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

<col>
<p>
<col>
</p>

</body>
</html>

Syntax 1: Valid, col absent; col optional element
Syntax 2: Valid, 1 or multiple col elements nested within colgroup element with no span attribute: allowed
Syntax 3: Invalid, col nested within elements (head, body, p) other than colgroup: not allowed

Video demonstration nesting col

HTML5 col parents Tutorial

min video details
00:06 video tutorial: col nested inside elements;
elements nested inside col
00:11 col element can be nested only inside colgroup element IF span attribute is absent on it (on colgroup)
if both span and col are present, span attribute is ignored
00:20 span attribute present on colgroup → col element can't be nested inside colgroup element
00:31 inside col element no element can be nested because there's no "inside"; col element has only 1 tag, the start tag
col intro col browser display col syntaxcol span attribute