Command Palette

Search for a command to run...

Hectal
Back to the lesson: Topic 6.2 — Titles and Meta Descriptions
HTML · Example 1 of 2

A search result preview built from the head

Real engines cut by pixel width, not by character count; 60 and 160 characters are good rules of thumb.

The <title> names the page on tabs, bookmarks and search results, and the meta description is your suggested summary under it; both should be unique, specific and short enough not to be cut off.

Change the code and press Run (Ctrl+Enter). Predict what will happen first, then break it on purpose and read what changes. Your edits are saved and match the lesson page.

Ready for more? This phase has 6 hands-on exercises with automatic checks.

Practice questions

Write the code in the editor, run it, then open the model answer to compare.

01

Write a title and a meta description for a page that sells a blue cotton school bag for ₹899 on a shop called BagBazaar.

02

Write a JavaScript function setUnread(n) that sets the title to Inbox — Mailo when n is 0 and to (n) Inbox — Mailo otherwise. Call it with 0 and 5 and log the title.

Explain it without notes

01

Name five places where a page's <title> is used.

02

What makes a good title for a recipe page, and why does word order matter?

03

Does the meta description affect ranking? Why write one anyway?

04

Why might Google show a different title than the one you wrote?

A search result preview built from the head

Preview

Press Run to see the page.

Console

Nothing logged yet.

Expected console output

Title length: 48 ok
Description length: 118 ok