Lesson 1.4. Comments in HTML


As with all languages, HTML code can be commented. The comment starts with <!-- and ends with -->. It can straddling several lines, it is the equivalent of the /* */ in C language. Of course, it is not interpreted by the browser.


In the example below, we can see that the first line is not interpreted by the browser :

<!-- Unordored list of special characters-->
    <li>&amp; AMPERSAND</li>
    <li>&lt; LESS THAN</li>
    <li>&gt; GREATE THAN</li>
    <li>&ecirc; CIRCUMFLEX</li>
    <li>&eacute; ACUTE ACCENT</li>
    <li>&egrave; E GRAVE ACCENT</li>
    <li>&agrave; A GRAVE ACCENT</li>

The previous code displays the next page in which the text unordered list of characters is not displayed:

See also

Last update : 03/10/2022