skip to main content

TAMU Webmaster's Blog

Information and insight from the A&M Webmasters

There is an entity on your computer screen…

April 24th, 2009 by mdmcginnis

The word “entity” sounds like something creepy from a horror or sci-fi film, but HTML entities are actually beneficial. They allow webmasters to put typographical characters on their pages that don’t appear on their keyboards, including characters from mathematics, finance, and even letters from other alphabets. Your blogging or web design software may offer shortcuts for using them, sometimes even converting them automatically.

Some entities are absolutely necessary: since angle brackets ( < >) are also used in HTML code, they will not even appear on the screen unless you use the correct entities (&lt; &gt;). Other entities are practical, even beautiful, such as the bullet (&bull;), paragraph mark (&para;) and the double-quotes (&laquo; &raquo;) used in French. I’ve just started using the ellipsis entity (&hellip;) instead of three periods… because it has cool spacing. Still other entities are strongly encouraged: the ampersand is a reserved character, so if you don’t use the correct entity (which is &amp;) for it, your page won’t be valid XHTML, or even valid HTML. That’s important for accessibility, and as someone who’s done a lot of web scripting, I can assure you that consistent, valid pages are much easier to work with. It’s hard to write code to tell a computer how to guess whether a person meant & or &amp;.

HTML entities allow you to imitate the special typographical features of your word processor on a web page, without resulting in ugly or incomprehensible characters. In your browser, depending on your character encoding, “curly quotes” may look like these: “ “ “. You usually see them because content was cut-and-pasted into a web page directly from a Microsoft Word® document. Now, if you like “curly quotes” you can still use them in your web pages. I just did, by searching-and-replacing the quotation marks with the HTML entities &ldquo; and &rdquo; instead. They just aren’t very noticeable in this font. If you don’t care if your quotes look different depending of whether they’re on the left or the on the right, search the text for curly quotes and replace them all with &quot;.

Besides quotation marks, another entity you may want to use is the em dash (&mdash;): longer — and more authoritative — than a hyphen. According to the Texas A&M System Style Guide:

Put a space on both sides of the dash in all uses except the start of a paragraph.

You can find lists of HTML entities at the Web Standards Project and W3Schools, but here are some of the common ones. You can specify them by name or by code number, but I find the names are easier to remember:

Character Description Entity Name Entity Number
em dash &mdash;
  non-breaking space &nbsp;  
< less than &lt; <
> greater than &gt; >
& ampersand &amp; &
¢ cent &cent; ¢
© copyright &copy; ©
® registered trademark &reg; ®
" quotation mark &quot; "
left double quotation mark &ldquo;
right double quotation mark &rdquo;
bullet &bull;
ellipses &hellip;
Friday, April 24th, 2009 HTML
Share this article

No comments yet.

Leave a comment