freecoding.school100% FREE · NO SIGNUP
Markup CityISSUE #8 of 39

paragraphs · the workhorse tag

Tagg the BuilderVSThe Unclosed Tag
Tagg the Builder saysThe <p> element holds a paragraph of text — the most common block on most pages.

Wrap running text in <p>. The browser adds vertical spacing between paragraphs automatically and collapses extra whitespace inside them, so your indentation and line breaks in the source don't affect output.

Need an actual line break inside a paragraph? Use <br>. But don't use empty paragraphs for spacing — that's CSS's job (margins). And you can't nest a <p> inside another <p>.

Power-ups you unlock

The Unclosed Tag attacks — common mistakes

Boss battleType a paragraph with several spaces and line breaks in the source. Confirm the output collapses them, then add a <br> where you actually want a break.

Example code

<!doctype html>
<html><head><meta charset="utf-8"></head>
<body>
  <p>This is one paragraph. The   extra   spaces   collapse.</p>
  <p>This is a second paragraph.<br>With a forced line break.</p>
</body></html>
▶ Open the interactive comic issue
‹ Headings · H1 Down To H6Inline Styles · Before Css Arrived ›