Smal SEO Tool

HTML Entities

Reserved characters in HTML must be replaced with character entities to be displayed correctly.

What Are Character Entities?

Some characters are reserved in HTML. For example, you cannot use the less than (<) or greater than (>) signs within your text, because the browser might mistake them for tags. To display these characters, you must use their corresponding character entities.

An entity can be referenced by its name (e.g., &lt;) or by its number (e.g., &#60;).

Common HTML Entities

  • For < you can write &lt; or &#60;
  • For > you can write &gt; or &#62;
  • For & you can write &amp; or &#38;
  • For " you can write &quot; or &#34;
  • For ' you can write &apos; or &#39;

Non-Breaking Space

A common character entity used in HTML is the non-breaking space: &nbsp;.

A non-breaking space is a space that will not break into a new line. Two words separated by a non-breaking space will stick together (not break into a new line). It is handy for keeping words together that should not be separated.

Example: Using &nbsp;

html
<p>This will keep 10 km/h together.</p>

Test Yourself with an Exercise

Which entity is used to display a less-than sign (<)?