I’m a complete beginner, so please bear with me! I’m having a problem in Introduction to HTML, “The Body” section. Whenever I try to put in the < symbol, it says “Special Characters Must be Escaped.” What does this mean, and how do I do it? Here’s the link to the exercise: https://www.codecademy.com/courses/learn-html/lessons/intro-to-html/exercises/body-html.
You must select a tag to post in this category. Please find the tag relating to the section of the course you are on E.g. Forms, Structure
When you ask a question, don’t forget to include a link to the exercise or project you’re dealing with!
If you want to have the best chances of getting a useful answer quickly, make sure you follow our guidelines about how to ask a good question. That way you’ll be helping everyone – helping people to answer your question and helping others who are stuck to find the question and answer!
The left and right carats (< & >) are central to all markup elements in HTML. One rule does apply, though… No whitespace.
< body >
is not a recognized HTML element so the parser will not treat it as an element. However, the complaint here is that < is a special character, meaning it has special meaning. The only way we can treat it as a printable character is if we escape it.
\<
The above is known as an escape sequence which tells the parser to treat the character following the \ (escape character) as any other printable character and waive any special meaning. In other words, escape parsing this character and render it as text.
Bottom line,
<body>
</body>
Note: parsing is the evaluation phase in the rendering process. It is the extracting of meaningful HTML elements and rendering them according to the specifications the parsing engine follows. Search engines do this in kind of the opposite way to glean only the printed text from an HTML document. The parser wants only the markup elements.
I get that error message with this code but it seems to match the code in the walkthrough (for the Adhoc project in the Bootstrap section). Usually when I get that error message, the code still works, so I ignore it. But in this case the logo isn’t rendering. The alternative text is being rendered instead.
I’m confused about those(what I call) non-lethal error messages. I don’t know if its always this error message, but several times during lessons I get an error message that highlights something in red and puts a red dot next to the line number. But it still passes me to the next step. An example of this is while I was trying to fix the problem with the above code, I noticed another non-lethal error message below it. I forgot the closing tag for the unordered list of the navbar items. But even though I did that, the navbar still rendered correctly. Although, If that was a lesson step for making lists, it wouldn’t have passed me. At least a partial explication for this during the lessons, is that the mistakes that incite the non-lethal error messages don’t pertain to the lesson or at least that specific step in the lesson. Or maybe it thinks it would confuse us by correcting too many errors at once.
HTML is not a programming language so there are no ‘fatal runtime errors’ (exceptions that would terminate program execution). The program running in the background of the code editor is a, linter that checks HTML syntax and offers cautions where things may not align with well-formedness or valid markup. LE error messages are generated by the SCT based upon expected patterns.