MakeW3web

Reserved Characters

In HTML, there are certain reserved characters that have special meanings in the context of the markup language. These characters are used as part of the HTML syntax and should be represented using character entities when they need to be displayed as plain text within your content. Using character entities for reserved characters ensures that they are not misinterpreted as part of the HTML code.

Here is a list of some commonly reserved characters in HTML:

  1. Less than sign (`<`): Used to denote the beginning of an HTML tag. To display a less than sign, use the character entity `&lt;`.
<p>The value of x is less than 5: x &lt; 5</p>

  1. Greater than sign (`>`): Used to denote the end of an HTML tag. To display a greater than sign, use the character entity `&gt;`.

<p>The value of x is greater than 5: x &gt; 5</p>

  1. Ampersand (`&`): Used as a prefix for character entities. To display an ampersand, use the character entity `&amp;`.

<p>Use the &amp; character to create HTML entities.</p>

  1. Quotation mark (`"`): Used to define attribute values within HTML tags. To display a quotation mark, use the character entity `&quot;`.

<p>She said, &quot;Hello, World!&quot;</p>

  1. Apostrophe (`'`): Although not as commonly used as the quotation mark for attribute values, the apostrophe can also be used for this purpose. To display an apostrophe, use the character entity `&apos;`.

<p>It&apos;s a beautiful day!</p>

When using these reserved characters in your HTML content, always remember to use the corresponding character entities to ensure that they are displayed correctly and not interpreted as part of the HTML markup.

Was this page helpful?