HTML Academy
Let’s finish marking up our pages
HTML document structure14/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 meta tag, which is used for keywords
  • Sign up
  • Log in

Loading…
Everything will be ready in few seconds

  • Theory
  • Theory
  • Comments

The meta tag, which is used for page character encoding

Great job! We’ve finished marking up the content. Now, let’s return to the <head> tag.

Notice inside the <head> is a <meta> tag. This is a single tag. In other words, it does not require a paired closing tag at the end.

The <meta> tag provides information about the page to browsers, search engines and other software. This can include the character encoding or a short description of the page. To do this, <meta> tags with various attributes and values are used. Here are some of the attributes: charset, content, http-equiv and name.

You can use the charset attribute to specify the character encoding for the HTML webpage:

<meta charset="name of character encoding">

It is always best to specify the character encoding explicitly. Otherwise, the browser may guess the encoding incorrectly and display garbled characters instead of your intended text.

The most widely used encoding in current use is utf-8. You should use it in all of your projects. Previously the windows-1251 encoding was widely used, as it was the standard encoding for Cyrillic in Windows. However, now this is considered to be bad practice.

<meta>, <link>, <title> and other tags that are included in <head> contain a special type of content — metadata. This metadata is not displayed on the page directly, but rather it is used to store information about the document and to connect the document to other documents and systems.

Comments

  • index.html
HTML
<!DOCTYPE html> <html lang="en"> <head> <meta charset="windows-1251"> <title>The website of a beginning coder</title> <link rel="stylesheet" href="outlines.css"> </head> <body> <header> <h1>The website of a beginning coder</h1> </header> <main> <nav> Navigation </nav> <section> <p>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 was even assigned an instructor, Muffin, who won’t let me slack off and will track my progress.</p> <p>My first assignment is to keep a diary and honestly write about all of my accomplishments.</p> </section> <section> Skills section </section> </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. Change the webpage character encoding from windows-1251 to utf-8 in the <meta> element inside <head>.

    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.