HTML 11-Jan-2026 at 06:59 UTC1 min read

HTML Series: Entities - How to Write Special Symbols (©, <, >) in Code?

HTML Series: Entities - How to Write Special Symbols (©, <, >) in Code?
Loading...

The "Broken Code" Mystery

Let's try a small experiment. Go to your code and type this sentence in a paragraph: "I think 5 < 10 is true."
Ad not available
Ad not available
The Problem: The browser will panic. Why? Because when it sees the < symbol, it thinks: "Oh! A new tag is starting here!" It expects a tag name like <div> or <p>, but it finds a number. This can break your entire page layout.
The Solution: You cannot type "Reserved Characters" directly. You must use their secret code names, known as HTML Entities.

1. The Big 3: Reserved Characters

These are the characters that control HTML syntax. You must escape them.
Example: To display the text <h1>, you cannot just type it. You must write: &lt;h1&gt;

2. The Invisible Glue: &nbsp; (Non-Breaking Space)

This is the most misunderstood entity in HTML history.
The Behavior: If you press "Space" 10 times in your code, HTML collapses it into 1 single space. The Fix: If you reallywant extra spaces, you use &nbsp; (Non-Breaking Space).
Ad not available
Ad not available

Do NOT use &nbsp; for layout.

Bad: Home &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; About (Using spaces to push text to the right). Good: Use CSS margin or padding for gaps.

Use &nbsp; only to "glue" words together. Example: 10&nbsp;kg. This ensures that "10" and "kg" always stay on the same line and don't break apart on small screens.

3. Professional Polish: Copyright & Currency

Look at the footer of any big website (Apple, Amazon, Google). Do they write (c) 2026? No. They write © 2026.
To look professional, you need correct typography.
  • Copyright: &copy; → ©
  • Trademark: &trade; → ™
  • Registered: &reg; → ®
  • Bullet: &bull; → •

Currency Symbols

If you are building an Indian E-commerce site, you need the Rupee symbol.
  • Rupee (₹): &#8377;
  • Euro (€): &euro;
  • **Dollar ($):** &dollar; (Or just type $\)

Did you know Emojis are just characters?

While modern UTF-8 allows you to copy-paste emojis directly (😀), sometimes you need the code to be safe across old databases. &#128512; → 😀 &#128640; → 🚀


The AI Angle: Reliability

AI tools often copy-paste the direct symbol (e.g., they will just write ©). Technically, this works in modern browsers.
But... if your file encoding ever breaks (e.g., opening the file in an old text editor), © might turn into `` (The "Unknown Character" Diamond). Using &copy; is bulletproof. It works everywhere, forever.

6. Practical Task: The Professional Footer 🛠️

Let's polish our index.html footer. It currently looks plain.
Step 1: Open index.html
Ad not available
Ad not available
Step 2: Scroll down to the <footer> section. 
Step 3: Update the code using Entities.
🛑 STOP! DO NOT JUST COPY PASTE! Reading the code is not enough. You need to type these strange codes (&copy;&#8377;) yourself to remember them.
html
<footer>
    <hr>
    <p>&copy; 2026 Sunny. All rights reserved.</p>
    
    <p>Made with &hearts; in India &#8377;</p>
</footer>
Step 4: Open Live Server.
  • Look at the bottom.
  • See the clean ©?
  • See the ?
  • See the ?
That is the sign of a detailed developer.

Summary Table: Cheat Sheet

SymbolEntity NameEntity Number
<&lt;&#60;
>&gt;&#62;
©&copy;&#169;
&hearts;&#9829;
N/A&#8377;
Space&nbsp;&#160;

Conclusion

We have cleaned up our code, added structure, optimized for SEO, and now polished our symbols.
But we are forgetting someone. We can see the website. We can see the emojis. We can see the colors. But what about users who cannot see? What about blind users who rely on "Screen Readers" to browse the web?
If your code isn't "Accessible," you are blocking 15% of the world's population from your site.
In the next blog, "Web Accessibility (A11y)," we will learn the moral duty of a developer. We will learn about Alt TextARIA Roles, and how to make a website that everyone can use.
See you in the next post!
You can Read next part from here - READ NOW!

HTML Series: Your First Step in Modern Web Development (2026)

Step 18 of 22


Ad not available
Ad not available