Home » HTML Entities

HTML Entities

HTML Entities

Introduction

In HTML, proper handling of reserved characters and invisible spaces is crucial for accurate rendering. HTML entities are employed to represent specific characters and symbols in a way that browsers can interpret correctly.

Reserved Characters in HTML

Certain characters hold special meanings in HTML and require representation using entities to prevent misinterpretation:

  • < (less than) is represented as &lt;
  • > (greater than) is represented as &gt;

HTML Character Entities

HTML character entities come in two formats: entity names and entity numbers.

  • Entity Names: &entity_name;
  • Entity Numbers: &#entity_number;

Common HTML Character Entities:

ResultDescriptionEntity NameEntity Number
Non-breaking spaceRepresents a space that will not break into a new line.  
<Less than sign<<
>Greater than sign>>
&Ampersand&
Double quotation mark
Single quotation mark
¢Cent¢¢
£Pound££
¥Yen¥¥
Euro
©Copyright©©
®Trademark®®

Note: Entity names are case-sensitive.

Combining Diacritical Marks

Diacritical marks, which include accents, can be seamlessly combined with alphanumeric characters using entity numbers. This practice allows the creation of characters that may not be directly present in the character set used on the page.

Examples:

MarkCharacterConstructResult
̀aàà
́aáá
̂aââ
̃aãã
̀OÒ;Ò
́OÓÓ
̂OÔÔ
̃OÕÕ

Conclusion

Understanding and effectively utilizing diacritical marks through entity numbers contribute to the diversity of characters that can be displayed in HTML. This skill expands the range of symbols and characters available for web content creation.

Frequently Asked Questions