HTML Guide
CourseHTML Entities and Symbols
Core Concept
100% Comprehensive

HTML Entities and Symbols.

HTML entities are used to display reserved characters (like < or >) and special symbols (like symbols, emojis, or currency) that aren't on your keyboard.

The Essentials

01

Entities start with an ampersand (&) and end with a semicolon (;).

02

&lt; and &gt; are used for less-than and greater-than symbols.

03

&amp; is used for the ampersand symbol.

04

&copy; is the copyright symbol (©).

05

&nbsp; is a non-breaking space (it prevents a line break).

06

Numeric codes like &#128512; can be used for emojis (😀).

Professional Insights

Reserved Characters

Browsers interpret < and > as tags. If you want to show the text '5 < 10', you must write '5 &lt; 10' or the browser might think you are starting a new tag.

Non-Breaking Space (&nbsp;)

Use &nbsp; when you want two words to stay on the same line together (e.g., '10 km'). It prevents the browser from splitting them up.

Unicode and UTF-8

Modern HTML5 uses UTF-8 by default, which supports almost every character in existence. This means you can often type emojis directly into your code, but entities are safer for legacy systems.

HTML Symbols

There are thousands of symbols for math (∏, ∑), currency (¢, £, €), and arrows (←, ↑, →, ↓) available via entities.

Critical Pitfalls

Forgetting the semicolon at the end of the entity (e.g., writing &copy instead of &copy;).

Using < and > directly in text, which can cause rendering bugs.

Overusing &nbsp; for layout spacing instead of using CSS margins.

Thinking all emojis have easy-to-remember names; most require numeric codes.

Interactive Lab

Sprint Tasks

01
Display the text: '5 < 10' using entities
02
Add a copyright symbol followed by '2024 DevPeak'
Loading editor...
Production Preview