Whitespace in HTML

Intro

One thing to keep in mind when writing HTML is that the browser will ignore extra whitespace in your code.

Whitespace in this case means blank lines or extra spaces in your text.

Steps

Extra blank lines

As an example, try adding extra blank lines between these paragraph elements by pressing Enter.

If you save and look at the preview, everything still looks the same. This is a good thing, because you can use blank lines to separate sections of code without worrying about them changing the way the web page looks.

Extra spaces

You can also add extra spaces between words without affecting how the web page looks.

Try adding some extra space between words in the first paragraph element.

The paragraph should still look the same in the preview. Now this second feature isn’t really something you’ll take advantage of, it’s just something to be aware of.

So that’s how you can use whitespace in HTML.

Final code

If you’ve followed all of the steps so far, this is the code that should be in between the body tags.

Complete and Continue