html · level 1 · unit 1 · lesson 4
- meet it
- guess first
- your turn
- fix it
- nailed it
Tap a green word if you get lost.
meet it
<p> wraps each of ordinary text.
A paragraph is a block of ordinary text, one or more sentences about one thing. Wrap each one in <p> and </p>. The browser leaves a small gap between paragraphs.
Here is a surprise. The browser squashes : every run of spaces, tabs and new lines in your code shrinks to one single space.
So pressing Enter in your code does not start a new line on the page. To start a new paragraph, use a new <p>.
<h1>My dog Biscuit</h1>
<p>Biscuit is three years old.</p>
<p>He loves long walks
and stealing socks.</p> Press show my page to see it here.
Look at the last paragraph: on the page, the extra spaces and the new line vanish.
guess first
Lots of spaces. How will this look?
Guess before you run it. Wrong guesses are how you learn, and nothing is marked.
<p>Hip hip
hooray!</p>
your turn
Your turn. Write about your weekend.
Finish the first paragraph. Then, on line 3, add a second paragraph about Sunday, wrapped in its own <p> tags.
Press show my page to see it here.
- there are two paragraphsnot checked yet
- the first paragraph says what you didnot checked yet
fix it
The sentences are squashed together. Can you fix it?
Press show my page to see it here.
- each sentence is its own paragraphnot checked yet
- sun cream comes firstnot checked yet
- On the page, both sentences sit on one line. Why?
- Pressing Enter in your code does not start a new paragraph. Only a new
<p>does. - Close the first paragraph with
</p>, then open a new<p>before Pack your hat.
nailed it
your words have room to breathe. :D
- Wrap each paragraph in
<p>and</p>. - The browser squashes extra spaces and new lines.
- A new paragraph needs a new
<p>.
new words in your collection
- paragraph
- whitespace
This lesson isn’t saved. A free account remembers every lesson you finish.