Introduction
HTML, or Hypertext Markup Language, is the primary language for structuring web pages. It collaborates with CSS and JavaScript to define content, appearance, and behavior. HTML comprises elements enclosed in angle brackets, encompassing various webpage components like headings, paragraphs, images, and links. The standard structure includes the , , and elements. HTML facilitates hyperlink creation through the tag, enabling seamless navigation between web pages. HTML5, the latest version, introduces new elements and attributes, enhancing web functionality and accessibility. In essence, HTML serves as the foundation for creating structured, interactive web content, essential for web development and design.

HTML entities and special characters
About Lesson

HTML entities are special codes used to represent characters that have special meaning in HTML, such as reserved characters (<, >), accented letters (é, ñ), symbols (©, ™), and mathematical symbols (≤, ∑). These entities are particularly useful when you want to display characters that are not part of the standard ASCII character set or when you need to escape characters with special meaning in HTML.

Here are some common HTML entities and their corresponding characters:

1. **Reserved Characters:**
– `<` is represented by `&lt;`
– `>` is represented by `&gt;`
– `&` is represented by `&amp;`
– `”` is represented by `&quot;`
– `’` is represented by `&apos;`

2. **Accented Letters:**
– `é` is represented by `&eacute;`
– `ñ` is represented by `&ntilde;`
– `ü` is represented by `&uuml;`

3. **Symbols:**
– `©` is represented by `&copy;`
– `™` is represented by `&trade;`
– `€` is represented by `&euro;`

4. **Mathematical Symbols:**
– `≤` is represented by `&le;`
– `∑` is represented by `&sum;`
– `∞` is represented by `&infin;`

5. **Special Characters:**
– Non-breaking space (` `) is represented by `&nbsp;`
– Bullet point (`•`) is represented by `&bull;`
– Horizontal ellipsis (`…`) is represented by `&hellip;`

You can use HTML entities directly in your HTML code to display special characters or escape reserved characters. For example:
“`html
<p>&lt;Hello World&gt;</p> <!– Displays “<Hello World>” –>
<p>&copy; 2024 MyCompany</p> <!– Displays “© 2024 MyCompany” –>
<p>&euro; 10.99</p> <!– Displays “€ 10.99” –>
“`

Using HTML entities ensures that your HTML code remains valid and correctly renders special characters, regardless of the character encoding or browser support.

Join the conversation