Information about cookies on this page

Our website uses cookies to ensure the functionality of the website, to collect and analyze information about the performance and usage of the website. Privacy Policy

  • Courses
    • Discord
    • Twitter
    • Linkedin
    • Facebook
    • Instagram
  • Pricing
  • English
  • Čeština
  • Deutsch
  • Русский
Sign inStart free
  • Courses
  • Pricing

Community

Sign in
  
  • Courses
    • Discord
    • Twitter
    • Linkedin
    • Facebook
    • Instagram
  • Pricing
  • English
  • Čeština
  • Deutsch
  • Русский
Sign inStart free
  • Courses
  • Pricing

Community

Sign in

Page Title and Character Set

Now let's put something into head. Almost every web page has these two elements there.

The first one is title, the title of the page. The browser shows it in the tab (in the picture from the previous exercise, it was Start Coder), and search engines such as Google show it as the headline of each search result. The preview here has no tab, so you won't see the title in it, but it's there.

<title>My First Page</title>

The second one is meta, short for metadata, which means data about the page. This one tells the browser which character set the page is written in, so that it reads letters such as é, ñ or č correctly instead of showing strange symbols. utf-8 is a character set that covers the letters of almost every language in the world.

<meta charset="utf-8">

There are two new things here. The charset="utf-8" part is called an attribute. We'll explain attributes in the lesson on advanced HTML elements, so for now, just copy it as it is. And meta has no closing tag, because it has no content. A few other elements work the same way, and we'll meet them later.

The meta element goes first in head, before title, so that the browser knows how to read the letters before it gets to any text:

<head>
	<meta charset="utf-8">
	<title>My First Page</title>
</head>

Instructions

  1. 1

    Inside the head element, create a title element with a title for your page, for example My First Page.

  2. 2

    Above the title element, as the first element inside head, add <meta charset="utf-8">.

Back

5/9

  1. 1. Introduction to HTML
  2. 2. HTML Element Structure
  3. 3. Document Type Declaration
  4. 4. Page Skeleton
  5. 5. Page Title and Character Set
  6. 6. Quiz: The Page Title
  7. 7. Nesting and Family Relationships
  8. 8. Indentation
  9. 9. Recap
Next

Try it yourself

Do this exercise right here in your browser. No account needed.