Lesson 28 / الدرس 28

Entities & symbols / الكيانات والرموز

HTML reserves <, > and & for its own syntax, so to show one of them as plain text you write a short code called an entity instead — plus a handful of others, like &nbsp; and &copy;, for characters your keyboard cannot type.

تحتفظ HTML بالحروف < و> و& لصياغتها الخاصة، ولذلك تكتب لإظهار أي منها كنص عادي رمزًا قصيرًا يسمى كيانًا بدلًا من الحرف نفسه — إضافة إلى عدد آخر منها، مثل &nbsp; و&copy;، لحروف لا تستطيع لوحة مفاتيحك كتابتها مباشرة.

You have seen <p> written out as plain text dozens of times in this course, to show you a tag without the browser turning it into a real one. This lesson explains exactly how that trick works, and gives you the small set of codes — called entities — that let you write a character HTML would otherwise treat as part of its own syntax.

The three that matter most

<p>Use 5 &lt; 10 and 10 &gt; 5 to compare numbers.</p>
<p>Tom &amp; Jerry is a cartoon.</p>
Run this. &lt; writes a literal less-than sign, &gt; a literal greater-than sign, and &amp; a literal ampersand — the browser draws the character itself, not the code you typed.

Every entity starts with an ampersand and ends with a semicolon; that is how the browser recognizes one. Which raises the obvious question: what if you want to show a literal ampersand? You cannot just type it, because the browser would try to read whatever comes right after it as the start of an entity name. That is exactly why &amp; exists — it is the entity for the one character that entities themselves are built from.

Beyond the basic three: &nbsp; and &copy;

&nbsp; is a non-breaking space — an ordinary space the browser will never break a line on, handy for keeping something like "10 km" together on one line. &copy; writes the copyright symbol: ©. HTML defines hundreds of entities like these, for currency signs, accented letters, arrows and more — but &lt;, &gt;, &amp;, &nbsp; and &copy; cover almost everything you will need for now.

<p>Room&nbsp;4 is at the end of the hall.</p>
<p>&copy; 2026 Amman Dates. All rights reserved.</p>
Run it — &nbsp; keeps "Room" and "4" on the same line no matter how narrow the screen, and &copy; draws ©.
EntityResultWhat it is for
&lt;<A literal less-than sign
&gt;>A literal greater-than sign
&amp;&A literal ampersand
&nbsp;(a space)A space the browser will not break a line on
&copy;©The copyright symbol

The five entities in this lesson.

That is really the whole rule: &lt;, &gt; and &amp; exist only because the characters they represent already mean something to HTML itself. Everything else — Arabic letters, English letters, numbers, most punctuation — you type exactly as it is, the way you have done in every lesson so far.

Try it live / جرّب بنفسك

Preview / المعاينة

Check yourself / اختبر نفسك

1. Which entity writes a literal ampersand character?

2. You write a real less-than sign directly in your text instead of an entity. What is the risk?

3. What does &nbsp; do?

Your task / مهمتك

Write a short shop page: one paragraph comparing two prices with &lt; or &gt;, one paragraph naming a shop like Books & Coffee written correctly with &amp;, and a copyright line at the bottom using &copy;.

اكتب صفحة متجر قصيرة: فقرة تقارن بين سعرين باستخدام &lt; أو &gt;، وفقرة تسمّي متجرًا مثل Books & Coffee مكتوبًا بشكل صحيح باستخدام &amp;، وسطر حقوق نشر في الأسفل باستخدام &copy;.

  • At least one &lt; or &gt; used correctly استخدام &lt; أو &gt; واحد على الأقل بشكل صحيح
  • An ampersand written with &amp;, not typed directly علامة عطف مكتوبة بـ&amp;، لا مكتوبة مباشرة
  • A copyright line using &copy; سطر حقوق نشر باستخدام &copy;
  • No literal less-than or greater-than character left in your paragraphs لا إشارة أصغر-من أو أكبر-من حرفية متبقية في فقراتك
How do you want to submit? / كيف تريد التسليم؟