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 and ©, for characters your keyboard cannot type.
تحتفظ HTML بالحروف < و> و& لصياغتها الخاصة، ولذلك تكتب لإظهار أي منها كنص عادي رمزًا قصيرًا يسمى كيانًا بدلًا من الحرف نفسه — إضافة إلى عدد آخر منها، مثل و©، لحروف لا تستطيع لوحة مفاتيحك كتابتها مباشرة.
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.
<p> مكتوبًا كنص عادي عشرات المرات في هذه الدورة، ليُظهر لك وسمًا دون أن يحوّله المتصفح إلى وسم حقيقي. يشرح هذا الدرس بالضبط كيف تعمل هذه الحيلة، ويعطيك المجموعة الصغيرة من الرموز — وتسمى الكيانات (entities) — التي تتيح لك كتابة حرف كانت HTML ستتعامل معه كجزء من صياغتها هي.The three that matter most
<p>Use 5 < 10 and 10 > 5 to compare numbers.</p>
<p>Tom & Jerry is a cartoon.</p>
< writes a literal less-than sign, > a literal greater-than sign, and & 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 & exists — it is the entity for the one character that entities themselves are built from.
& — فهو كيان الحرف الذي تُبنى منه الكيانات نفسها.< أو > المكتوبة مباشرة داخل نصك ليست آمنة لمجرد أنها تظهر بشكل صحيح اليوم. فالمتصفح يقرأ كل < على أنه بداية وسم محتملة؛ وحسب الحرف الذي يليه، قد يتحوّل نصك بصمت إلى عنصر لم تقصده أبدًا، ويختفي جزء من محتواك. اكتب دائمًا < و> بدلًا من ذلك، حتى في الحالات التي تبدو آمنة.
Beyond the basic three: and ©
و©
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. © writes the copyright symbol: ©. HTML defines hundreds of entities like these, for currency signs, accented letters, arrows and more — but <, >, &, and © cover almost everything you will need for now.
مسافة غير قابلة للكسر — مسافة عادية لن يقسّم المتصفح السطر عندها أبدًا، وتفيد في إبقاء شيء مثل "10 km" معًا على سطر واحد. أما © فيكتب رمز حقوق النشر: ©. وتُعرّف HTML مئات الكيانات المشابهة، لرموز العملات والحروف المنقّطة والأسهم وغيرها — لكن < و> و& و و© تغطي تقريبًا كل ما تحتاجه الآن.<p>Room 4 is at the end of the hall.</p>
<p>© 2026 Amman Dates. All rights reserved.</p>
keeps "Room" and "4" on the same line no matter how narrow the screen, and © draws ©.
كلمتَي "Room" و"4" على السطر نفسه مهما ضاقت الشاشة، ويرسم © الرمز ©.| Entity | Result | What it is for |
|---|---|---|
| < | < | A literal less-than sign |
| > | > | A literal greater-than sign |
| & | & | A literal ampersand |
| | (a space) | A space the browser will not break a line on |
| © | © | The copyright symbol |
The five entities in this lesson.
/search?q=dates&page=2 هو HTML غير صالح من الناحية التقنية، ويجب أن يُكتب هكذا: /search?q=dates&page=2 بدلًا منه. اعتد على هذا الآن ولن تحتاج للتفكير فيه لاحقًا.
That is really the whole rule: <, > and & 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.
< و> و& موجودة فقط لأن الحروف التي تمثّلها تحمل بالفعل معنى خاصًا عند HTML نفسها. أما كل ما عداها — الحروف العربية، والحروف الإنجليزية، والأرقام، ومعظم علامات الترقيم — فتكتبه كما هو تمامًا، كما فعلت في كل درس سابق.Try it live / جرّب بنفسك
Check yourself / اختبر نفسك
1. Which entity writes a literal ampersand character?
& is the entity for the ampersand — the same character every entity starts with, which is exactly why it needs its own entity.
& هو كيان علامة العطف — وهي الحرف نفسه الذي يبدأ به كل كيان، ولهذا بالضبط تحتاج إلى كيان خاص بها.2. You write a real less-than sign directly in your text instead of an entity. What is the risk?
The browser treats every < as a possible tag opening. Depending on what follows it, your text can silently become part of an element you never meant to create.
< على أنه بداية وسم محتملة. وحسب ما يليه، قد يتحول نصك بصمت إلى جزء من عنصر لم تقصد إنشاءه أبدًا.
3.
What does do?
؟ is a non-breaking space — useful for keeping two words glued to the same line.
مسافة غير قابلة للكسر — تفيد في إبقاء كلمتين ملتصقتين على السطر نفسه.Score / النتيجة: 0 / 3
Your task / مهمتك
Write a short shop page: one paragraph comparing two prices with < or >, one paragraph naming a shop like Books & Coffee written correctly with &, and a copyright line at the bottom using ©.
اكتب صفحة متجر قصيرة: فقرة تقارن بين سعرين باستخدام < أو >، وفقرة تسمّي متجرًا مثل Books & Coffee مكتوبًا بشكل صحيح باستخدام &، وسطر حقوق نشر في الأسفل باستخدام ©.
-
At least one
<or>used correctly استخدام<أو>واحد على الأقل بشكل صحيح -
An ampersand written with
&, not typed directly علامة عطف مكتوبة بـ&، لا مكتوبة مباشرة -
A copyright line using
©سطر حقوق نشر باستخدام© - No literal less-than or greater-than character left in your paragraphs لا إشارة أصغر-من أو أكبر-من حرفية متبقية في فقراتك