• 0 Posts
  • 13 Comments
Joined 2 years ago
cake
Cake day: June 3rd, 2023

help-circle











  • The reason is because a programmer at some point decide that & should indicate the start of a special symbol in HTML. In programming parlance this is a means of “escaping” characters which are reserved.

    For example, in HTML, things look something like this:

    <p>Hello, World!</p>
    

    The p in the less than and greater symbol symbols means “paragraph” where the ending version with the slash means “the paragraph is done”.

    However, there’s a problem. What if you wanted to actually type out <p> to the end-user and have it not be treated as HTML? You use the ampersand syntax to write &lt; by using &lt; and > by using >.

    </p><p>&lt;p></p>
    

    Yet another problem: If we use &amp; as a special character in HTML, we also need a way to display it—the answer is &amp;