DONATE  
MENU
JSON
AJAX
HTML
JAVASCRIPT

HTML Tutorials

INTRODUCTION

» Introduction to HTML

» PRACTICE IT Editor

» Getting Started

» HTML Example

» HTML Tags

» HTML Elements

» Nesting Tags

» Block & Inline Elements

» HTML Attributes

» HTML Comments

» File Paths

» HTML Entities & Symbols

TAGS/ELEMENTS

» Important Tags

» HTML Headings

» Text Formatting

» HTML Links

» HTML Lists

» HTML Tables

» HTML Images

» HTML Audios

» HTML Videos

» HTML Iframes

» HTML Styles

» HTML Scripts

» Semantic Elements

» HTML Metadata

ATTRIBUTES

» Elements' ID

» Elements' Class

» Elements' Style

» Element's Align

» Element's Height & Width

HTML FORMS

» HTML Forms

» Input Elements

» HTML Textarea

» HTML Select

HTML EXAMPLE

» Login Page

.. » HTML » Introduction » HTML Entities & Symbols
Share Tweet WhatsApp

HTML Entities & Symbols

HTML entities are names or codes used in displaying HTML reserved keywords or symbols. They are formed with an ampersand(&) and followed by the individual entity's name or code.
&entityCode;
&entityName;
HTML entities basically allows us to display certain signs without having them interpreted for what they really are in the "eyes" of a browser. For example, whenever a browser sees (<b></b>) in an HTML document, it is a tag/element and as such, won't be display. What if we sincerely want to display that tag as part of a paragraph or whatever element's texts? We therefore make use of HTML entities' equivalents of the less and greater than signs (< >), which browsers use in recognizing HTML tags. EXAMPLE Without HTML entities
<p>
An image in a webpage is created with the <b><img></b> tag.
</p>

Copy PRACTICE IT

With HTML entities
<p>
An image in a webpage is created with the <b>&lt;img&gt;</b> tag.
</p>

Copy PRACTICE IT

Another great example Another great example is that of HTML attributes whose values are contained in either single('') or double quotes(""). Assuming an attribute value is contained in single quotes and inside that value are one or more single quotes, what happens. Without HTML entities
<input type='text' placeholder='Your father's name'/>

Copy PRACTICE IT

In the result of the above example, notice the placeholder attribute text is not fully interpreted when the webpage is viewed. It displays Your father instead of Your father's name and this is because, since the value is contained in single quotes, the single quote in father's is marking the end of the single quote in which the value is contained. We therefore solve this with the help of the HTML entity equivalent of single quote which is "&apos;".
<input type='text' placeholder='Your father&apos;s name'/>

Copy PRACTICE IT

Another great use of HTML entities is in displaying symbols not existing on our keyboards. For example, Greek alphabets. SOME HTML ENTITIES/SYMBOLS
OutputDescEntity/Symbol NameEntity/Symbol Code
non - breaking space &nbsp;&#160;
<less than&lt;&#60;
>greater than&gt;&#62;
&ampersand&amp;&#38;
"double quotation mark&quot;&#34;
'single quotation mark (apostrophe)&apos;&#39;
¢cent&cent;&#162;
£pound&pound;&#163;
¥yen&yen;&#165;
euro&euro;&#8364;
©copyright&copy;&#169;
®registered trademark&reg;&#174;
trademark&trade;&#8482;
leftwards arrow&larr;&#8592;
upwards arrow&uarr;&#8593;
rightwards arrow&rarr;&#8594;
downwards arrow&darr;&#8595;
black spade suit&spades;&#9824;
black club suit&clubs;&#9827;
black heart suit&hearts;&#9829;
black diamond suit&diams;&#9830;
SUMMARY
  1. HTML entities helps us in displaying HTML reserved keywords on our websites.
  2. They also help in displaying symbols, which are not existing on our keyboards. For example, Greek alphabets.
  3. An HTML entity starts with the ampersand (&), followed by the entity name or code and finally, a semicolon (;). Entity codes starts with the symbols(&#).
Take a short quiz on HTML Entities & Symbols.
Ask a question or tell us if HTML Entities & Symbols is easy or not.
cent?

Join our 1,090 subscribers to receive tutorials' updates!

  We won't spam your mail box. We hate it.





StackBeginner 2021 © Joseph Omamode