pre keeps whitespace, code shows tags safely
The newline right after <pre> was dropped. The escaped tags became text, not elements.
HTML has small elements that say exactly what a piece of text is: a quotation (blockquote, q, cite), an abbreviation (abbr), contact details (address), a date (time), or computer text (code, pre, kbd, samp, var).
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.
Mark up this sentence: "In the book Clean Code, the author writes: functions should do one thing." (a short in-line quote and a book title).
Write a line that shows an event at 6:30 pm on 1 May 2026 in India (UTC+05:30), shown to humans as "May Day evening".
Show the instruction "Press Ctrl+Shift+I to open DevTools" and a code block showing <h1>Hi</h1>.
Explain it without notes
What's the difference between the cite attribute and the cite element?
Why does time have a datetime attribute when the date is already written in the text?
Explain how to show a block of HTML code on a web page so it displays as text.
When would you use kbd versus samp versus code?
Preview
Console
Nothing logged yet.Expected console output
"Preformatted text\n keeps every space\n"
<p>Hello & welcome</p>
Elements inside the code: 0