w3-video.com logo

HTML5 Tutorial

Home HTML5 XAMPP .htaccess Firefox Notepad++

Share it

!Doctype declaration, first element

Classified as: -

Parents, Doctype declaration

Children, Doctype declaration

Doctype, first element Example

Valid Syntax
<!doctype html>



Video demonstration DOCTYPE declaration, place in page

HTML5 doctype - first element of the page, Tutorial

min video details
00:00 video tutorial: doctype declaration, place in page
00:05 doctype declaration must be the first element in page before any other HTML element
00:12 doctype declaration can be placed:
- on the 1st line,
- on the 2nd line
- on the 3rd line
...it does not matter as long as it's the first element added on page
00:19 doctype declaration cannot be nested inside HTML elements:
e.g. doctype nested inside html → invalid syntax
00:25 also, no element can't be nested inside the doctype declaration (it has no 'inside', no end tag)
00:32 doctype declaration as first element in page goes:
- before the html start tag, but if absent then
- before head start tag, but if absent then
- before meta tag...
00:00 remember:
no HTML5 element should be placed before <!doctype html>