Command Palette

Search for a command to run...

Hectal
Back to the lesson: Topic 1.3 — Text Formatting and Meaning
HTML · Example 2 of 3

wbr: a long word in a narrow box

The first box overflows: the browser has nowhere to break the word. The others wrap at the <wbr> points. Widen the box to 600px and every <wbr> does nothing.

Text-level elements mark what a word means: <strong> for importance, <em> for stress, <mark> for highlights, <del>/<ins> for edits, <sub>/<sup> for small raised or lowered text, and a few more; the look comes free, but the meaning is the point.

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 5 hands-on exercises with automatic checks.

Practice questions

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

01

Mark up: Caution: the floor is wet. The word café comes from French. Use the right element for the warning and for the French word.

02

Mark up a sale price: the old price ₹1,200 is crossed out because it's no longer valid, and the new price ₹900 is shown after it. Add a fine-print line underneath saying offers end Sunday.

03

Write the formula for the area of a circle, A = πr², using a superscript.

Explain it without notes

01

Explain the difference between <strong> and <b>, and between <em> and <i>.

02

When do you use <del>/<ins> and when <s>?

03

What do <hr> and <wbr> do?

04

Why not choose these elements for how they look?

wbr: a long word in a narrow box

Preview

Press Run to see the page.

Console

Nothing logged yet.