«
»


EMDASH HTML Code

Posted by Marty Dickinson on Apr 20, 2009

The EMDASH is one of the most mis-used, neglected, mysterious marks in the written language. Toss the Internet in there requiring HTML to make the emdash and a whole can of worms opens up for the novice coder. Using a CMS or blog software like WordPress can empower even the most tech UNsavvy administrator to create their own words on an html page, but what happens when they want to emphasize something in a sentence?

Instead of using a proper emdash, which looks like — the writer comes up with convenient alternatives like italic text (hard to read), improperly used quote marks (just wrong gramatically), underlining (making people think there is a link to click), over use of bolding (a real turn off), improper use of two hyphens — (my favorite!), or just plain USING CAPITAL LETTERS, which we all know and love :).

So, what do we do about this emdash for the web? It’s simple. The code to use for wherever you want to place emdash html code is — (or — but I usually use the — so I’m assured it will work right in older browser versions too).

Here’s how it works.

1) Open your editor so that you are in HTML view
2) Write your sentence for where you want emdash html code to go
3) Add html code between the two words for where you want your emdash to appear

Here’s a correct example:

[Showing HTML] Then I fell in the water—really cold water!
[Result] Then I fell in the water—really cold water!

Not this:

[Showing HTML] Then I fell in the water — really cold water!
[Result] Then I fell in the water — really cold water!

See how I have a space on either side of the html code? That’s not right. A proper emdash needs to butt up to each word.

| Permalink | Trackback

Click a Star to Rate This Post:
Tell Others About This Post:
Email This Post to a Friend Email This Post to a Friend

6 Comments »

Anonymous:

— also works.

December 10th, 2011 | 9:04 am
Anonymous:

The two hyphens is leftover from the days of typewriters that did not have an em dash, hence people used to introduce the two hyphens to indicate the em dash.

It is archaic, but not–from what I have leaned–technically “wrong.” But I could be mistaken.

January 31st, 2012 | 11:19 pm
Bernard:

Thank you for succinctly explaining the proper use of an em dash via HTML. Exactly what I needed for a project.

February 23rd, 2012 | 12:38 pm

This came in handy as I just wanted to know what the html was for emdash and learned a little more too. Great simple informative post. Google brought me here for “em dash html code”.

March 16th, 2012 | 11:31 am

Your examples and the extra emphasis you put on what an error looks like make this a very useful and easy to remember lesson.

Thank you for the extra time you took to make this such a high quality explanation of how to use and em dash.
- Peter

May 10th, 2012 | 6:42 pm

Whether you put a space on each side of the em dash depends upon which style manual you adhere to. AP Style requires a space on each side.

June 27th, 2012 | 10:35 pm
Leave a Reply

Comment