When the browser analyses HTML code, each lower sign <
is interpreted
as the begining of a tag and is not displayed. It then becomes impossible to display the
lower sign symbol on a web page. The developers encounter interpretation problems:
The solution to these problems is the use of a special syntax for displaying special characters. The name of the character is surrounded by an ampersand (at the beginning) and a semicolon (at the end):
As an example, the following HTML code displays some of the most common special entities:
<!-- Non ordered list of special characters -->
<ul>
<li>& AMPERSAND</li>
<li>< LESS THAN</li>
<li>> GREATE THAN</li>
<li>ê CIRCUMFLEX</li>
<li>é ACUTE ACCENT</li>
<li>è E GRAVE ACCENT</li>
<li>à A GRAVE ACCENT</li>
</ul>
The previous code displays the following page when interpreted by the browser:
You will find many sites listing the special characters in HTML. In the following of the course, accents will be deliberately omitted to keep example easy to understand.
You may have already noticed that consecutive spaces are replaced by
a single space when rendered in the browser. You can compel
the browser not to delete a space and prohibit the line feed on this
space. The special character & nbsp;
displays a non-breakable space.
& nbsp;
stands for Non-Breaking SPace .
Write a HTML code that displays the following HTML tags in the page. Tags must not be rendered as in the following example: