HTML Academy
The main tag for main content
HTML document structure6/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 section tag, which is used for semantic sections
  • Sign up
  • Log in

Loading…
Everything will be ready in few seconds

  • Theory
  • Theory
  • Comments

The header and footer tags

In addition to the unique main content of the page, we have an introductory part and a concluding part that are repeated on other pages.

The <header> tag describes the introductory part of the page, which is often called the “header”. Similarly, the <footer> tag describes the concluding part of the page, or the “footer”.

<header>
  I am the website header. I can be repeated on other pages.
</header>
<main>
  I am the main content! I live only on this page.
</main>
<footer>
  I am the website footer. I function similarly to the header.
</footer>

Usually, the <header> and <footer> tags appear only once per page, but they may also be used repeatedly.

Let’s mark up the header and footer for the main page. For now, let’s use text “placeholders” to stand for the content.

The <header> tag not only provides the website header with a logo and a menu. It can be used, for example, as the “header” for some article or section of the website. Of course, in the context of an article, <header> is not called a “header”, but the introduction, which may contain headings, a table of contents, and so forth.

The situation is similar for <footer>. Typically this is the footer of the website, where copyright information, contact information, and similar information are listed. But <footer> may be used in other sections of the website. For example, you can add the following additional information within an article in the “footer”: information about the author, additional links, and so on.

Comments

  • index.html
HTML
<!DOCTYPE html> <html lang="en"> <head> <title>The website of a beginning coder</title> <link rel="stylesheet" href="outlines.css"> </head> <body> <main> 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. </main> </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. Before the tag <main> add the tag <header> with the text Website header,
    2. and then after <main> add the tag <footer> with the text Website footer.

    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.