HTML Academy
The HTML doctype, or document type declaration
HTML document structure2/19
Back to the list of tasks
  • 1. The HTML doctype, or document type declaration
  • 2. Basic HTML tags
  • 3. The head tag, which provides metadata information about the page
  • 4. The title tag for page titles
  • 5. The main tag for main content
  • 6. The header and footer tags
  • 7. The section tag, which is used for semantic sections
  • 8. The nav tag, which is used to specify the main navigation
  • 9. The article tag, which is used to indicate an independent section
  • 10. The aside tag, which is used to specify additional content
  • 11. The h1-h6 and title tags in HTML
  • 12. The p tag for paragraphs
  • 13. Let’s finish designing our pages
  • 14. The meta tag, which is used for page character encoding
  • 15. The meta tag, which is used for keywords
  • 16. Let’s connect another frame to the page
  • 17. Summary of “HTML document structure”
  • 18. First challenge
  • 19. First mastery challenge
The head tag, which provides metadata information about the page
  • Sign up
  • Log in

Loading…
Everything will be ready in few seconds

  • Theory
  • Theory
  • Comments

Basic HTML tags

OK, so now we have figured out the doctype. Now let’s start working directly on the content.

The very simplest HTML page consists of at least three tags: <html>, <head> and <body>.

The <html> tag follows immediately after the doctype declaration in the document and contains all other tags, including <head> and <body>. Usually, the important attribute lang (an abbreviation for “language”) is added to the <html> tag. It specifies the main human language of the document. Our website will be in English, so we should indicate the following value for lang:

<html lang="en">

The <head> tag is used to store important metadata (data about the page that helps the browser display it), whereas the <body> tag contains webpage content that is displayed in the browser window. We will add all text and images inside the <body> tag. The head and body tags may only be used once inside a document.

Let’s start working on the template for the main page of our website!

You can assign the attribute lang to any tags if you need to specify the particular language of the text enclosed by the tags. But if you specify this attribute for the <html> tag, then the attribute will be applied to the entire document.

Comments

  • index.html
HTML
<!DOCTYPE html> <html> <head> </head> <body> <!-- Greetings to everyone! Welcome to my first site. Up until just recently I had no idea what a coder does for a living, but now I have found interactive courses in HTML and CSS and I have set myself the goal of becoming one. I even was assigned an instructor, Muffin, who does not allow me to slack off and will track my progress. My first assignment is to keep a diary and honestly write about all of my accomplishments. --> </body> </html>

What didn’t you like in this task?

Thanks! We’ll fix everything at once!

The code has changed, click “Refresh” or turn autorun on.

You’ve gone to a different page

Click inside the mini-browser to shift the focus onto this window.

100%
Goalscompleted
0
    1. Add the attribute lang with the value en to the tag <html>.
    2. Uncomment the text inside <body>.

    Cookies ∙ Privacy ∙ License Agreement ∙ About ∙ Contacts ∙ © HTML Academy OÜ, 2019−2025

    VISAMastercard

    Log in

    or

    Forgot your password?

    Sign up

    Sign up

    or
    Log in

    Restore access

    Have you forgotten your password or lost access to your profile? Enter your email connected to your profile and we will send you a link to restore access.

    Forgot to connect your email to the profile? Email us and we’ll help.