When starting a new HTML document, one of the first things to do is write your document type declaration. A doctype declaration tells the browser that the page to be rendered is written in HTML. To declare an HTML5 doctype, `<!DOCTYPE html>` is required in the first line of your HTML document. Doctype declaration for HTML5 is not case sensitive and does not require a closing tag.
What to Include in a New HTML Document
In addition to doctype declaration, you’ll also need to include `html`, `head`, and `body` tags.
<!DOCTYPE html> <html> <head> <!-- Metadata for the site. --> </head> <body> <!-- Content the viewer will see. --> </body> </html>
HTML Element
The HTML tag communicates to the web browser that everything within the opening html tag, `<html>` and the closing html tag, `</html>` is HTML text.
Head Element
The head element stores metadata for the browser. This metadata could include information like what language the page is written in, a title for the web page, or a link to a style sheet.
Body Element
Take this quiz to get offers and scholarships from top bootcamps and online schools!
See your matchesThe body element contains the information that the viewer will see. There are several tags included within the body element. These might include a <p> tag for paragraphs, <ol> tag for ordered lists, <li> tag for list items, or the <a> tag for links.
Other Doctypes You May Find

For HTML5 documents, you can declare the doctype with the code `<!DOCTYPE html>`, but you may also find legacy code written for previous doctypes. The doctype declaration prior to HTML5 was more complicated because it referred to a DTD, or Document Type Definition. Previous versions of HTML doctype declarations include:
HTML 4.01 Strict
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
HTML 4.01 Transitional
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
HTML 4.01 Frameset
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
XHTML 1.0 Strict
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
XHTML 1.0 Transitional
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
XHTML 1.0 Frameset
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
XHTML 1.1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
The good news? There is no reason to use one of the older doctypes if you are writing a new HTML document!
Conclusion
In conclusion, each HTML document must begin with a doctype declaration. This declaration communicates to the browser that the web page will be rendered in HTML. If you’re new to HTML, check out our guide here: Learn HTML: A Guide to Learning Hypertext Markup Language, or read our article How Long Does It Take to Learn HTML?
About us: Career Karma is a platform designed to help job seekers find, research, and connect with job training programs to advance their careers. Read more