thecodezone.
The Code Zone
Short steps, at your pace · Free lessons and practice · Member video walkthroughs
Save your next small win.

Checking your account…

01.03 · Introduction to HTML / Practice · 10 min

Basic HTML Structure

Keep browser metadata in the head and visible page content in the body.

Activity 3 of 4 in Introduction to HTML

All courses

HTML Basics / 01.03

Basic HTML Structure

Not started

Keep browser metadata in the head and visible page content in the body.

More options

Your lesson progress

Walkthrough: not startedPractice: not started

Empty: not started. Yellow: in progress. Green: complete. Marking the whole activity complete does not replace your test results. These circles save in this browser for this pilot.

Rob illustrates keep browser metadata in the head and visible page content in the body.
Rob’s comic strip · Introduction to HTML

ORIGINAL WALKTHROUGH · 9:52

Watch with Rob.

Pause whenever you want to try a change. You can return to the lesson at any time.

LEARN WITH THE CODE ZONE

Unlock this video walkthrough

Written lessons and coding practice are free. Video walkthroughs are included with a paid Code Zone membership or an active free trial.

Have a Code Zone website account? Use your learning account’s email to get a six-digit sign-in code, or use your existing website password.

Need a website account? Paid Skool members and active trial members can use the email from their membership questions to request a sign-in code. No invite link or Skool password needed.

Close this window to keep practicing. After signing in, you’ll return to this lesson.

Video walkthroughs are included with an active Code Zone membership. The written lesson and practice are free.

Open video & code editor (opens in a new tab)

Starter source code for VS Code

Copy the source below or download the file to follow along in VS Code.

The download includes a lesson link in each file and a README so you can find your way back.

index.html
index.htmlhtml · example
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>My first page</title>
  </head>
  <body>
    <!-- Code along with Rob here. -->
  </body>
</html>

Read the skeleton from the outside

<!DOCTYPE html> asks for modern standards rendering. The html element is the root. Inside it, head holds metadata and body holds the visible page content. lang="en" identifies the language used in this example.

The title appears in a browser tab, not as the visible heading. The h1 supplies the heading on the page.

Read the skeleton from the outside
index.htmlhtml · example
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>My first page</title>
</head>
<body>
  <h1>Welcome</h1>
</body>
</html>

Give each part its job

The head describes the document: title names the browser tab, meta describes settings such as character encoding, and link can load a stylesheet. Put the content people read—headings, paragraphs, lists and images—inside body. Neither head nor body is a visible heading.

Fix this bug: Why is the page blank? The starter puts heading and paragraph markup inside title. A title is text metadata, so that markup does not become visible page content. Keep a short text title in head, then move the h1 and p into body. The preview should show Welcome and its paragraph. A bare h1 directly inside head is different: browsers may repair it by moving it into body, so that is not a reliable blank-page bug.

YOUR TURN

Fix this bug: Why is the page blank?

The visible content is inside the browser-tab title. Open index.html and follow the checklist to separate the head and body.

To pass this challenge
  • Inside the head element, make the title display only My first page.
  • Inside the body element, add one h1 with the visible text Welcome. Close it.
  • Immediately after that heading, add one p with the visible text This is my first structured page. Close it.
  • Remove those visible-content words from the title. Keep the supplied doctype, language and metadata.

Edit HTML, then run it to see the page. Check Challenge checks the rendered elements. Word wrap is enabled.

Ready to checkRun the checks to see your results here.

Need a nudge?

Tab title versus page heading

Edit the text inside title in head. Wrap Welcome with h1 in body. These serve different purposes.

Give the sentence a paragraph

Use <p> before the sentence and </p> after it, inside body.

Replace your editor code?

Your current work will be replaced. Choose Cancel to keep it.

Ready to try it?

Practice in your browser and see your results.

Progress details

Have a question?

Ask the Code Zone community.

Ask a question in The Code Zone (opens in a new tab)

Continue learning

ONE STEP FORWARD

These checks inspect the browser-parsed HTML from your current source. They check the listed requirements, not every possible HTML validity or accessibility rule.