Skip to content

Courses / HTML5 Mastery: Complete Beginner to Advanced Course / HTML Comments & Characters

645 people viewed this

HTML Comments & Characters

  • It supports characters from many writing systems.
  • It is compatible with ASCII for the ASCII character range.
  • It is widely supported by modern browsers, servers, databases, and development tools.
  • It reduces the need to represent every non-ASCII character using a numeric character reference.

In a modern HTML project, UTF-8 is usually the appropriate default. Also ensure that the source file is actually saved using UTF-8; a meta declaration cannot reliably correct a file that has already been saved with the wrong encoding.


9. Multilingual Websites and Language Support

A multilingual website must handle both character encoding and language identification correctly.

Example: English and Odia

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Multilingual Page</title>
</head>
<body>
  <h1>Welcome</h1>

  <p lang="or">
    ନମସ୍କାର। ଆପଣ କେମିତି ଅଛନ୍ତି?
  </p>

  <p lang="hi">
    नमस्ते। आप कैसे हैं?
  </p>
</body>
</html>

The page is primarily identified as English, while the Odia and Hindi paragraphs declare their own languages.

Language metadata helps screen readers choose appropriate pronunciation rules and can help translation and text-processing tools interpret content correctly.

Unicode Does Not Guarantee a Particular Appearance

Correct encoding does not guarantee that every character will look identical on every device. Rendering depends on font availability, operating-system support, browser behavior, and language-specific shaping.

If a symbol appears as a square or missing-glyph box:

  • Check whether the correct character is present in the source.
  • Confirm that the document and source files use UTF-8.
  • Check whether an appropriate font is installed or loaded.
  • Test the page in another browser or device.

10. Common Special Characters in Real-World Websites

Copyright and Trademark Notices

<footer>
  <p>&copy; 2026 Codementrix. All rights reserved.</p>
  <p>Example brand name&trade;</p>
</footer>

Mathematical Expressions

<p>Less than: 5 &lt; 10</p>
<p>Greater than: 10 &gt; 5</p>
<p>Infinity: &infin;</p>
<p>Square root: &radic;25 = 5</p>

Currency Symbols

<p>Indian Rupee: ₹1,000</p>
<p>Euro: &euro;99</p>
<p>Pound: &pound;75</p>
<p>Yen: &yen;500</p>

Modern UTF-8 HTML can usually contain the actual symbols directly. Named character references are another option.

Non-Breaking Spaces

The &nbsp; character reference inserts a non-breaking space. It prevents the browser from breaking a line at that particular space.

Rate this course

5.0 · 1 rating

Stars show on this course. Your written note stays private.

Your stars