So far you have typed only the visible part of a page. A complete HTML document has a little more around it:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>My First Page</title>
</head>
<body>
<h1>Hello!</h1>
</body>
</html>
<!DOCTYPE html>goes on the very first line. It tells the browser this is a modern HTML page.<html>wraps everything else. Itslangattribute says which language the page is written in (enfor English).<head>holds information about the page. Nothing in it is shown on the page itself.<meta charset="utf-8">makes sure letters like é and symbols like € show up correctly.<title>is the name shown on the browser tab and in search results.<body>holds everything visitors see: all the tags from the earlier lessons go here.
Browsers are forgiving and will show a page without these parts, which is why the earlier lessons worked. Real pages should always have them.
The title does not show in this preview, because the preview has no browser tab. The check will still find it.
Your Task
- Add a
<title>inside the<head>. - Add
lang="en"to the<html>tag. - Inside the
<body>, add an<h1>and a paragraph.
- The code starts with
<!DOCTYPE html> - The
<head>has a<title>with some text - The
<html>tag haslang="en" - The
<body>has an<h1>and a paragraph
Lesson complete!
Next Lesson: Sections of a Page