Exercises -- Stage 0: HTML Skeleton
Exercise 1: Change the page title
Goal: See how the title element affects the browser tab.
Steps:
- Open
index.htmlin your editor - Change
Burger Barninside the<title>tags toMy Restaurant - Save the file and refresh the browser
What happened: The browser tab now says "My Restaurant" instead of "Burger Barn." The title element controls the text in the tab, bookmarks, and search engine results. Change it back to Burger Barn when you are done.
Exercise 2: Remove the doctype
Goal: Understand why the doctype matters.
Steps:
- Delete the first line (
<!DOCTYPE html>) fromindex.html - Save and open the file in your browser
- Right-click the page, choose "Inspect", and look at the Console tab for any warnings
- Add the doctype back
What happened: The page might look the same for now (it is blank either way), but the browser switches to "quirks mode" without the doctype. Quirks mode uses older, inconsistent rendering rules. You can check which mode the browser is in by typing document.compatMode in the console -- "CSS1Compat" means standards mode, "BackCompat" means quirks mode.
Exercise 3: Add text to the body
Goal: Confirm that the body is where visible content goes.
Steps:
- Between the
<body>and</body>tags, type:Hello, world! - Save and refresh the browser
What happened: You see "Hello, world!" on the page. Anything inside the body element becomes visible content. Remove the text before moving to the next stage -- Stage 1 will add the real content.
Exercise 4: Break a tag on purpose
Goal: See how the browser handles invalid HTML.
Steps:
- Change
</head>to</hed>(a typo) - Save and refresh the browser
- Right-click, Inspect, and look at the Elements tab
What happened: The browser still renders the page. Browsers are forgiving -- they try to fix broken HTML silently. But the Elements tab may show an unexpected structure. Always close your tags correctly so the browser interprets your intent. Fix the typo before continuing.
Exercise 5: Change the language
Goal: See what the lang attribute does.
Steps:
- Change
lang="en"tolang="fr"on the<html>tag - Save and refresh the browser
- If you have browser translation features enabled, notice whether the browser now thinks the page is in French
What happened: The lang attribute does not change how the page looks, but it tells the browser and assistive tools what language the content is in. Screen readers use this to choose the correct pronunciation. Change it back to lang="en".