Character Reference Letters in HTML

There are some characters which have special meanings in HTML and they cannot be used directly into the web page and there are some which are unavailable on the keyboard of a computer. To display these kinds of characters in HTML we use the character reference letters. Character Reference is a method that allows us to include these kinds of characters. These references are often referred as entities but that’s not the case. Because entities are the SGML declarations and it is not tied to HTML5 any more in the document type declaration. Hence they are called character references (or character reference letter) not character entities as they refer to a character.

In HTML language there are five characters which create problems while using them in the document are the ‘<’, ‘>’, ‘ ’ ‘, ‘ “ ’ and & sign. If we use the less then ‘<’ sign it conflicts with the starting angle bracket of deferent tags. So to use these elements as characters in our document needs a method that is called Character Reference. These characters and many other characters can be used with three references name, decimal and hexadecimal. We have provided a list of all the references that can be used in an HTML document. Here is an example of some character references.

Code:

<!DOCTYPE html>

<!-- What are the Character References? howtocode.pk -->

 

<html lang="en">

<head>

<meta charset="UTF-8" />

<title>

HTML Character References from howtocode.pk

</title>

<style>

p.show {

background-color: #eef;

width: 25em;

font-size: 120%;

text-align: center;

padding: 1ex;

}

</style>

</head>

<body>

 

<p>

HTML Character References

</p>

 

<p>

Using character references I can display HTML tags like this:

</p>

 

<p class="show">

<code> &lt;p&gt; Content goes here. &lt;/p&gt; </code>

</p>

 

<p>

Many other interesting characters are available:

</p>

 

<p class="show">

&aacute; &agrave; &abreve; &AElig; &aelig; &approx; &approxeq;

&alpha; &beta; &delta; &gamma; &ohm; &mu;

<br />

&copy; &reg; &para; &commat; &dollar; &cent; &euro; &male; &female; &ofcir; &vartheta;

<br />

&Ascr; &Bscr; &Cscr; &Dscr; &Escr; &Fscr; &Gscr; &hellip; &Xscr; &Yscr; &Zscr;

</p>

 

</body>

</html>

Output:

HTML Character References | howtocode.pk

Using character references I can display HTML tags like this:

<p> Content goes here. </p>

Many other interesting characters are available:

á à ă Æ æ ≈ ≊ α β δ γ Ω μ
© ® ¶ @ $ ¢ € ♂ ♀ ⦿ ϑ

In the above code we are using ‘&lt;’ and ‘&gt;’ to display the left and right angle brackets. If we will not use these character references the code will be treated as an HTML code the result will be as follows for this paragraph.

Content goes here.

There are a number of character references available you can go to http://developers.whatwg.org/named-character-references.html#named-character-references and can find a very big list of all character references.

Comments