HTML Academy
The nav tag, which is used to specify the main navigation
HTML document structure9/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 marking up 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 try a different page layout
  • 17. Summary of “HTML document structure”
  • 18. First challenge
  • 19. First mastery challenge
The aside tag, which is used to specify additional content
  • Sign up
  • Log in

Loading…
Everything will be ready in few seconds

  • Theory
  • Theory
  • Comments

The article tag, which is used to indicate an independent section

Excellent. We have finished handling the main webpage blocks. We can now proceed to the internal page with the blog entry. It consists of the now familiar header, main content and footer.

The header for internal pages will be duplicated: it will contain the navigation block with a link to the main page. The main page contained a single <nav>, and it was included in <main>, but on the internal pages <nav> is repeated. Therefore, we can include it in <header>.

Only a post is contained inside <main> on the internal page, but later it may contain other sections, such as, for example, a tag cloud. Therefore, we need to enclose the post using some set of tags. Perhaps the <section> tag, which we are already familiar with, would do the job? Yes, that tag would work. But is there something else better?

We have in mind the <article> tag that denotes a self-contained and independent piece of information. A blog post is just such an example of this.

An <article> is intended to stand on its own, so it can be reused on another page or website. Examples include a complete article, a blog post or a forum post.

<article>
  I am a photo on Instagram. I look great anywhere.
</article>

You can use <section> tags inside <article> to mark distinct sections of its content.

Similarly, you can use <article> inside <section> if the logical section of the document contains independent content blocks.

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> <header> <!-- Add a navigation block here --> </header> <main> <!-- Day One. How I forgot to feed the cat. Who would have thought that semantics was so important? I had an urgent need to talk about it. The cat caught my attention. The cat kept meowing at me. And then I realized – it’s time for me to write the first blog entry. And to feed the cat. --> </main> <footer> Website footer </footer> </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 <nav> tag with the text Return to home to the website header.
    2. Uncomment the text inside <main> tag,
    3. and then enclose all of it using <article> tags.

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

    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.