Hyphens and Dashes
Hyphens are used to form compounds of two or more words and to separate some prefixes and suffixes from root words. Hyphens should never be used in place of dashes.
- A well-balanced developer will be versed in multiple languages.
- This is a once-in-a-lifetime opportunity.
- An anti-Flash mindset is spreading throughout the web community.
An en dash is the shorter dash (the width of an "n") and is used for ranges and combining open compounds. It should not be surrounded by a space at either side.
En dashes can be used to:
- take the place of hyphens when combining open compounds
- Jon Edwards, a North Dakota–based developer, started his own company in 2003.
- In this tutorial, you’ll learn how to embroider an Arrested Development–themed piece.
An em dash is the longer dash (the width of an "m") and is used to replace commas, parentheses, semi-colons, and colons in an informal setting. It should not be surrounded by a space at either side. Use em dashes sparingly.
Em dashes can be used to:
- indicate a break in a sentence
- I was just about to—
- explain or amplify a parenthetical element
- Steve Wozniak—one of the original founders of Apple—ceased full-time employment with Apple in 1987.
- separate a series of nouns from a clause summarizing them
- indicate an open range
- Mark Zuckerberg (1984—), is the CEO and founder of Facebook.
Note that neither hyphens nor dashes should be used to separate titles from subtitles, for this we use a colon.
- Going Pro with Photography: Your Guide to Making Money as a Photographer
- Quicksilver: A Mac User's Best Friend
A hyphen is typed simply by hitting the Hyphen key on the keyboard (-). Dashes are a bit more complicated.
- On a PC, hold down the Alt key and type 0150
- On a Mac, type Option-Hyphen (-)
- In HTML, use the escape code –
- On a PC, hold down the Alt key and type 0151
- On a Mac, type Shift-Option-Hyphen (-)
- In HTML, use the escape code —
- In many word processing applications, an em dash will automatically be created when you type two hyphens without a space. This is not the case if you're typing directly into WordPress.