Some characters have a special meaning in HTML, like the less than sign (<) that defines the start of an HTML tag. If we want the browser to actually display these characters we must insert character entities in the HTML source. The following HTML tutorial will go over the various HTML entities available for your use.

A character entity has four parts:

  • An ampersand (&),
  • An entity name or a #
  • An entity number,
  • Finally a semicolon (;).

 

The most common character entity in HTML is the non-breaking space. Normally HTML will truncate spaces in your text. If you write 10 spaces in your text, HTML will remove 9 of them. To add spaces to your text, use the 

 

Result Description Entity Name Entity Number
non-breaking space &nbsp; &#160;
< less than &lt; &#60;
> greater than &gt; &#62;
& ampersand &amp; &#38;
quotation mark &quot; &#34;
apostrophe &#39;
Result Description Entity Name Entity Number
¢ cent &cent; &#162;
£ pound &pound; &#163;
¥ yen &yen; &#165;
§ section &sect; &#167;
© copyright &copy; &#169;
® registered trademark &reg; &#174;
× multiplication &times; &#215;
÷ division &divide; &#247;

 

So let’s take a look at how we would go about writing this out. Let’s take a very common example, some footer copyright text:

<p>&copy; 2011 My Website &reg; All Rights Reserved </p>

This will produce the following:

© 2011 My Website ® All Rights Reserved

 

Published by Michael Boguslavskiy

Michael Boguslavskiy is a full-stack developer & online presence consultant based out of New York City. He's been offering freelance marketing & development services for over a decade. He currently manages Rapid Purple - and online webmaster resources center; and Media Explode - a full service marketing agency.

Leave a comment

Your email address will not be published. Required fields are marked *