Information about cookies on this page

Our website uses cookies to ensure the functionality of the website, to collect and analyze information about the performance and usage of the website. Privacy Policy

  • Courses
    • Discord
    • Twitter
    • Linkedin
    • Facebook
    • Instagram
  • Pricing
  • English
  • Čeština
  • Deutsch
  • Русский
Sign inStart free
  • Courses
  • Pricing

Community

Sign in
  
  • Courses
    • Discord
    • Twitter
    • Linkedin
    • Facebook
    • Instagram
  • Pricing
  • English
  • Čeština
  • Deutsch
  • Русский
Sign inStart free
  • Courses
  • Pricing

Community

Sign in

Document Type Declaration

What is a document type declaration?

It is a short piece of code at the very beginning of an HTML document. It tells the web browser that the document is written in today's HTML, so that the browser displays it correctly.

The document type declaration for HTML looks like this:

<!DOCTYPE html>

It has no closing tag. Upper and lower case don't matter here, so you may also come across <!doctype html>.

In this lesson, you will write the declaration yourself. From the second exercise of the next lesson on, the editor will hide it so that you can focus on the content of the page, and the preview will add it in the background for you. Still, remember it: every HTML document you create on your own must start with it, otherwise the browser may display your page incorrectly.

Instructions

  1. 1

    Write the HTML document type declaration on the first line of the code.

Back

3/9

  1. 1. Introduction to HTML
  2. 2. HTML Element Structure
  3. 3. Document Type Declaration
  4. 4. Page Skeleton
  5. 5. Page Title and Character Set
  6. 6. Quiz: The Page Title
  7. 7. Nesting and Family Relationships
  8. 8. Indentation
  9. 9. Recap
Next

Try it yourself

Do this exercise right here in your browser. No account needed.