Skip to main content

The 10 HTML Codes You Need to Know for Writing on the Web


Here are 10 HTML codes for common punctuation marks that you must know for your web writing to look elegant, professional and typographically correct.
The computer keyboard creates “dumb” punctuation marks that may not be acceptable in printed work but are common on web pages. It outputs straight quotation marks (") while your writing may require curly quotes. You can only type hyphens using the keyboard while an em or en dash may have made your text look more elegant and professional.
HTML Entities for Punctuation
HTML Entities for Punctuation

HTML Codes for Punctuation

Your keyboard lacks the keys for inserting the correct punctuation marks but there are simple HTML character codes, on entities, that you can use to mimic the typography of printed books on the web. Here’s a quick guide to using HTML codes for inserting typographically-correct punctuation marks in web writing.

Hyphens (-)

Hyphens, or half-dashes, are most commonly used to join together two or more words. You can type a hyphen directly without using any HTML codes.
  • The next-generation iPhone is expected to become available in mid-September.
  • The word email contains no hyphen but there’s one inside e-books and e-commerce.

Dashes (– —)

Dashes come in two sizes: the En dash (–) and the Em dash (—). The En dash is longer than a hyphen but shorten than an Em dash.
The En dash (–) is used for suggesting a range of numbers such as time periods, sports scores or page ranges.
  • Our bank is open 8a.m.–8p.m., Monday–Friday.
  • The players are disappointed after losing the match 3–1 to Spain.
  • Abraham Lincoln (1809–1865) was the 16th President of the United States.
The Em dash (—) is used to indicate breaks or pauses in a sentence, to quote sources or to separate a series of words within a phrase.
  • We plan to visit London this summer — if the visa is approved.
  • My three friends — John, Peter and Richards — are moving to New York.
  • “Well done is better than well said.” — Benjamin Franklin.

Ellipsis (…)

An ellipsis (…) is a series of three dots (periods) and two spaces in a row and they are used to indicate omission of one or more words in the quoted material. If the ellipses follow a complete sentence, end that sentence with a period, insert a space, then the ellipsis (…) followed by a space.
  • “All the world’s a stage, and all the men and women merely players.…” — Shakespeare
  • “I have a dream … they will not be judged by the color of their skin but by the content of their character.” — Martin Luther King, Jr

Quotes & Apostrophes (‘ ’ “ ”)

Your computer keyboard creates straight quotes (or dumb quotes) though what you really need to use are smart quotes (or curly quotes) that can be easily written in HTML. The dumb quotes are best used for writing programming code.
Use double quotation marks (“ and ”) to identify the exact words of a person, to indicate irony or for writing titles of creative works.
  • The last episode of “Friends” was the most-watched program of the year.
  • Thoreau said that “that government is the best which governs the least”.
  • They recalled the “toy safety” buttons as they were contained lead paint.
Use single quotes (‘ and ’) to indicate quotes within quotes. The right curly quotation mark (’) can also be used for smart apostrophe instead of the straight apostrophe.
  • John said, “I told her, ‘the traffic will only get worse.’”
  • Her answer was, “I’ll call you in the next hour or so.”

Prime (′ ″)

While we often use apostrophe (') or quotation marks to indicate units of measurement (like feet or seconds or degrees), the correct symbol is Prime that are likely slightly slanted quotes written as ′ (single) and ″ (double).
  • The height of this Ferrari car is 47′8″
  • I am currently at 27° 11′ 45.315″N, 78° 1′ 27.1668″ W.

Web Typography: Further Reading & Resources

Punctuation MarkSymbolHTML EntityCode Decimal
Apostrophe
En dash
Em dash
Ellipsis
Single Quote (open)
Single Quote (close)
Double Quote (open)
Double Quote (close)

Popular posts from this blog

27 Simple mehndi designs for hands for Karwa Chauth

The most  simple mehndi designs for hands  for Karwa Chauth 2014 Karwa Chauth  is around the corner and I am so excited about getting mehndi done! This time I plan to go with a simple yet quirky design. Don’t want my hands full, however it needs to be a style statement for this year’s most awaited festival for us ladies! There are some basic categories of mehndi designs, such as Gujrati, Rajasthani, Marwari,  Arabic  and African  patterns to choose from. They have certain prominent motifs or symbols that distinguishes one from the other. I just can’t seem to stop experimenting with these styles. From  circles to squares , peacocks and paisleys , checks and dots and what not. But my all-time favorite is a simple, curling vine, of course finger tips covered with thick coating of aromatic mehndi (which is so traditional). Quirky patterns include  traditional  as well as non-traditional patterns tweaked to one’s own liking. This includ...

Kick new song Hangover: Salman Khan’s singing stint is impressive!

The  Kick  star has lent his voice for his new song  Hangover The wait is over.  Hangover  is here! Last time, Salman Khan floored us all with his tapori stint in song  Jumme Ki Raat alongside Jacqueline Fernandez who sizzled with her sultry moves, donning a hot red lace dress. It seems along with giving us killer action sequences and  Dabangg  one liners, our very own Sallu  miyaan  can sing as well! The  Jai Ho  star’s highly anticipated singing stint in  Hangover  is finally out and we are happy to report that the Bhaijaan of B-town has certainly pleasantly surprised us all with his voice which has elements of a sexy twang and a Salman’s casual laid back back feel to it. The song on the whole is romantic, with a hint of zing added to it which makes it appealing to the ears. The tune is catchy and the lyrics are simple, which make  Hangover  a pleasant melody overall. We wonder what the video of ...

FOR MY BLOG READER'S

It is not for me but for my readers. 'One' resolution fROM taday: I want to look like Aamir khan (without 8 packs) Bike or Car (and why): Car, I’ve three reasons for it 1. It’s safer than bike 2. I’ve always dreamt of going on a long drive with my soul-mate in a car. 3. While driving a car you can look into the eyes of.......... obviously you can guess?? J A chance to fly or a chance to be invisible (and why): Invisible, I suffer from Acrophobia (an extreme or irrational fear of heights). I would love to love: My parents, they deserve my love more than anyone in this world. Most recent Dream I had: I’m a kid again. Teacher in the school asks to describe a word and I was struggling L If I were to marry today, I would: If the girl is pretty, I would be delighted. If the girl is not so ..., I wouldn’t marry and convince everybody that I’m underage (I’m actually 20 years old). My Dream Girl is/would be: SHEEEE Best F...