HTML Academy
The title tag for page titles
HTML document structure5/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 header and footer tags
  • Sign up
  • Log in

Loading…
Everything will be ready in few seconds

  • Theory
  • Theory
  • Comments

The main tag for main content

Let’s temporarily switch from metadata to content. We are currently designing the structure for our pages at the level of major blocks (introduction, main content, conclusion and so forth), and to do this we need suitable tags.

And the first such tag is the <main> tag. It is used to define the main content of the page. The main content excludes sections which are repeated on other pages, such as header and site logo, site-wide navigation and the footer of the site. Usually only one <main> is used on a single page.

<main>
  Hello, I am the main content! I live only on this page.
</main>

Our website will consist of several pages. Each of them will have a duplicate header and footer, as well as content unique to each page. We will enclose it using <main> tags.

The main page, which we are currently laying out, displays the introductory text. This text will constitute its main content, and it will not be reproduced on other pages. In other words, this text must be enclosed in a <main> tag. <main> will also be used to present other main content on internal pages.

The specification does not allow the use of more than one <main> tag on one page if they do not have the special attribute hidden. This attribute is added to the HTML element, such as, for example, in Single Page Applications to change the content of the page, which makes one or another <main> visible in various application states. The hidden attribute indicates to the browser that the element should not be displayed and used when the content of another element is displayed and used.

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> 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. Enclose the entire text in <body> with <main> tags.

    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.