HTML code for an apostrophe
Seemingly simple, but I cannot find anything relevant on the web.
What is the correct HTML code for an apostrophe? Is it ’
?
If you are looking for straight apostrophe '
(U+00027), it is
'
or '
(latest is HTLM 5 only)
If you are looking for the curly apostrophe ’
(U+02019), then yes, it is
’
or ’
As of to know which one to use, there are great answers in the Graphic Design community: What’s the right character for an apostrophe?.
A List Apart has a nice reference on characters and typography in HTML. According to that article, the correct HTML entity for the apostrophe is ’
. Example use: ’ .
It's '
.
As noted by msanders, this is actually XML and XHTML but not defined in HTML4, so I guess use the '
in that case. I stand corrected.
A standard-compliant, easy-to-remember set of html quotes, starting with the right single-quote which is normally used as an apostrophe:
- right single-quote —
’
— ’ - left single-quote —
‘
— ‘ - right double-quote —
”
— ” - left double-quote —
“
— “
Depends on which apostrophe you are talking about: there’s '
, ‘
, ’
and probably numerous other ones, depending on the context and the language you’re intending to write. And with a declared character encoding of e.g. UTF-8 you can also write them directly into your HTML: '
, ‘
, ’
.