HTML

Last Updated: 10/5/2022

Entities

  • Reserved characters in HTML must be replaced with character entities.
  • Eg < and > are reserved characters

Character Entities

Using name

&entity_name;

Using number

&#entity_number;

Examples

Display <

&lt; &#60;

Display pound

&pound; &#163;

&copy; &#169;

Display Registered Trademark

&reg; &#174;

Non-breaking Space

  • Two words separated by a non-breaking space will stick together not break into a new line. This is useful when breaking the words might be disruptive.
  • Prevent browsers from truncating spaces in HTML pages. &nbsp;

References