HTML ENTITIES

Maha



HTML Entities

In HTML, entities are used to represent special characters that might otherwise be interpreted as HTML code or that are not easily typed on a standard keyboard. These entities usually start with an ampersand (&) and end with a semicolon (;). Below is a list of some common HTML entities and their corresponding character.

Basic HTML Entities

  • & - & (ampersand)
  • &lt; - < (less-than)
  • &gt; - > (greater-than)
  • &quot; - " (double quotation mark)
  • &apos; - ' (apostrophe or single quotation mark


Accented Characters

  • &aacute; - á
  • &eacute; - é
  • &iacute; - í
  • &oacute; - ó
  • &uacute; - ú
  • &ntilde; - ñ
  • &ouml; - ö
  • &uuml; - ü


Mathematical Symbols

  • &plusmn; - ± (plus-minus)
  • &times; - × (multiplication)
  • &divide; - ÷ (division)
  • &le; - ≤ (less-than or equal to)
  • &ge; - ≥ (greater-than or equal to)


Currency Symbols

  • &dollar; - $ (dollar sign)
  • &euro; - € (euro sign)
  • &pound; - £ (pound sign)
  • &yen; - ¥ (yen sign)


Miscellaneous Symbols

  • &copy; - © (copyright)
  • &reg; - ® (registered trademark)
  • &trade; - ™ (trademark)
  • &sect; - § (section sign)
  • &para; - ¶ (paragraph sign)

How to Use HTML Entities

Displaying Special Characters:
When you need to display characters that might be confused with HTML syntax (e.g., <, >, &), use their corresponding entities.

Non-Standard Characters:
For characters that are not readily available on a standard keyboard, such as accented characters or special symbols, use the appropriate HTML entity.

Preventing Interpretation:
Using entities can prevent the browser from interpreting certain characters as HTML code, ensuring they are displayed correctly on the page..


Example:

  
  <!DOCTYPE html>
  <html lang="en">
  <head>
      <meta charset="UTF-8">
      <title>HTML Entities</title>
  </head>
  <body>
      <p>Use &lt; and &gt; to display less-than and greater-than symbols.</p>
      <p>Use &amp; to display an ampersand.</p>
      <p>Use &quot; and &apos; for quotation marks.</p>
      <p>Accented characters: &aacute;, &eacute;, &iacute;, &oacute;, &uacute;, &ntilde;.      </p>
      <p>Mathematical symbols: &plusmn;, &times;, &divide;, &le;, &ge;.</p>
      <p>Currency symbols: &dollar;, &euro;, &pound;, &yen;.</p>
      <p>Miscellaneous symbols: &copy;, &reg;, &trade;, &sect;, &para;.</p>
  </body>
  </html>


HTML provides a large set of entities for representing various characters. Here's a comprehensive list of HTML entities categorized by their types:

Reserved Characters



Mathematical Symbols




Greek Letters



Miscellaneous Symbols



Accented Characters



 Currency Symbols







More topic in HTML

Our website uses cookies to enhance your experience. Learn More
Accept !

GocourseAI

close
send