w3-video.com logo

HTML5 Tutorial

Home HTML5 XAMPP .htaccess Firefox Notepad++

Share it



br, optional element

The br element is optional.

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

<br>

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



</body>
</html>

Video demonstration br, optional element

HTML5 br, optional element, Tutorial

min video details
00:06 br element is optional:
→ it can be absent from the HTML page OR
→ it can be present
00:12 br ABSENT
00:12 br element: absent

the paragraph below does not contain the <br> tag
00:19 test in browser: the paragraph renders on 1 line
00:29 br PRESENT
00:29 br element: present

the 2nd paragraph contains the <br> tag
00:36 test in browser: the 2nd paragraph renders on 2 lines
br intro br browser display br parents br syntax