Whitespace Intro to HTML

In the Practice section HTML Document Standards there is a statement about the <span> element that I am not sure if this is different from other inline elements:

Choose the correct element for which the browser will NOT ignore the whitespace in the file while parsing the HTML document.

It refers to the <span> element and not the<p> <div>

Hi Alexis,

I had a look at the lesson Whitespace I can’t find what you’re talking about.

Just to clear it up:
When you put a <span> in a <p> and if you were to leave a line in between like this:

<p> this is for 
<span>testing purposes</span>
only</p> 

this is for testing purposes only

:arrow_up: This is how your it would render, the whitespace doesn’t make a difference.

The only difference will be if you were to not put any space before or after the span tag for example:

<p>testing<span>once again</span>, yeah yeah</p>

testingonce again, yeah yeah

:arrow_up: No space and the words are joined up.

Hope this clears it up :crossed_fingers:

2 Likes

Thanks! Nice to know about that piece of information as well. In the same section, there is an additional further practice that is mainly multiple-choice questions. Regarding this, it is about whitespaces.

Okay I went through the quiz again, this is the only whitespace question:

On the right the practice keeps on changing, I managed to get that section practice here are a few of the whitespace questions, let me know which one you need an explanation on:

The second image that has the as an answer. Thanks for the support.

1 Like

You’re welcome :slight_smile:

Whitespace inmost of HTML is treated the same way, they just posing the question another way.

span I explained in my last post