Highlight: Use an em dash, to set off a break in the flow of a sentence. Use an en dash to indicate a range of numbers, the minus sign, or negative numbers.
Em dashes
Use an em dash (—) also known as a long dash, to set off a break in the flow of a sentence. Em dashes are also used to provide emphasis for parenthetical phrases more than parentheses themselves. Don’t add spaces before and after the em dash. Don’t capitalize the first word after an em dash unless the word is a proper noun.
Use one em dash on each side of the phrase that is to be embedded.
Examples
styles.css
file.
styles.css
file.
You can also use one em dash to initiate a phrase at the end of a sentence.
Example
Don’t use an em dash as a bullet in a list. For more information, see Lists. Avoid using an em dash to indicate empty or unoccupied elements such as text fields, cells, and other values.
Typing em dashes
HTML
—
macOS
Press Option+Shift+hyphen.
Linux desktop environment
Enable the Compose key. (Instructions for doing that vary depending on your Linux distribution.) After the Compose key is enabled, you can create an em dash by typing the Compose key followed by three hyphens.
Alternatively, press Control+Shift+U, then let go of those keys, then type 2014, then press either the Return key or the Ctrl/Shift keys.
Note: These Linux options don’t work if you’re signed in to the Linux command line from a remote system using ssh or the like; you have to be in a Linux desktop environment.
Windows
Turn num lock on, then hold down the left Alt key and type 0151 on the numeric keypad.
En dashes
En dashes (–) are generally used to indicate a range of numbers, the minus sign, or negative numbers. Although you can use en dashes for these purposes, you can also use hyphens or the word to for numerical ranges.
Use an en dash indicate a range of numbers such as values or dates. Don’t add spaces before and after the en dash.
Examples
Use an en dash to indicate negative numbers and the minus sign. While writing an equation with a minus sign, insert a space before and after the minus sign (en dash). Contrarily, while writing a negative sign (en dash), don’t insert a space after it but do insert one before the sign.
Examples
For more information, see Ranges of numbers, Range of numbers with units, and Numbers and fractions.
Don’t use an en dash as a bullet in a list. For more information, see Lists. Avoid using an en dash to indicate empty or unoccupied elements such as text fields, cells, and other values.
Don’t use an en dash to indicate a range of times. Use the word to instead of the en dash. Use an en dash with no surrounding spaces for a schedule or listing.
Examples
In contrast, for date ranges consisting of two dates and times, use an en dash with spaces surrounding the dash.
Examples
For more information, refer Dates and times.
Typing en dashes
HTML
–
macOS
Press Option+hyphen.
Linux desktop environment
Enable the Compose key. (Instructions for doing that vary depending on your Linux distribution.) After the Compose key is enabled, you can create an em dash by typing the Compose key followed by two hyphens.
Alternatively, press Control+Shift+U, then let go of those keys, then type 2013, then press either the Return key or the Ctrl/Shift keys.
Note: These Linux options don’t work if you’re signed in to the Linux command line from a remote system using ssh or the like; you have to be in a Linux desktop environment.
Windows
Turn num lock on, then hold down the left Alt key and type 0150 on the numeric keypad.
Colons instead of dashes in lists
Sometimes writers use em dashes, en dashes, or hyphens surrounded by spaces in lists to separate a title or heading with its description. Ideally, use colons or description lists for separating them.
Examples