Project Fashion Blog

Hi,
I have some doubts doing the project Fashion Blog.

First, I get an error in this line
image
why does the editor indicate the error

special characters mus be escaped : [&]

I’m also writing this project externally and, at least, VSCode does not indicate an error (or warning)

Second, Task 5, asks for a <p> after an <h1> and the hint remembers me to indent, why? aren’t <h1> and <p> siblings, or should I consider them father and child?

Thanks in advance

& is usually written as &amp; in HTML  
because & is a special character that is used to make other characters show up on the webpage.
For example, &le; in the HTML shows up as ≤

Yes, the <p> and <h1> are siblings. I think the idea is that they should be indented more than the <body> element.

1 Like

In olden-speak, known as, ‘character entities.’ They actually predate HTML, but that is beside the point. Not to mention, we don’t need them in HTML5 since it is UTF-8 and a gazillion characters are now recognized and don’t need the explicit character encoding of the past.

We might still stumble into situations where we must fall back on the old encoding, but I can only think of one, &nbsp; which I’ve not seen a substitute for, as yet. Mind, we are behind the times so feel free to enlighten us.

What makes that one entity so crucial? It’s intended use case, that’s what. Who would like to see their proper name broken on a line break.

Blah blah lorem ipsum blah blan John
Williams blah blah lorem ipsum blah.

That was just a hand typed example, though it demonstrates wrap-around behavior at a right boundary. Were we to markup such that it would not render accordingly, we would explicitly include the entity.

John&nbsp;Williams

The rendering engine will not break these two textual elements apart, but will wrap before so they appear together on the next line.

Blah blah lorem ipsum blah blan
John Williams blah blah lorem
ipsum blah.

Other entities might fit this ‘needs must’ list, though I doubt there are many now that we have Unicode. Always open to new information.

3 Likes