单引号 html编码 转换,单引号的HTML代码

If you are looking for single quote, it is

'

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: ', ‘, ’.

Firstly, it would appear that ' should be avoided -

The curse of '

Secondly, if there is ever any chance that you're going to generate markup to be returned via AJAX calls, you should avoid the entity names (As not all of the HTML entities are valid in XML) and use the XXX; syntax instead.

Failure to do so may result in the markup being considered as invalid XML.

The entity that is most likely to be affected by this is  , which should be replaced by  

Here is a great reference for HTML Ascii codes:

The code you are looking for is: '

Note that ' IS defined in HTML5, so for modern websites, I would advise using ' as it is much more readable than '

Even though ' reads nicer than ' and it's a shame not to use it, as a fail-safe, use '.

' is a valid HTML 5 entity, however it is not a valid HTML 4 entity.

Unless is at the top of your HTML document, use '

' in decimal.

%27 in hex.

Although the ' entity may be supported in HTML5, it looks like a typewriter apostrophe. It looks nothing like a real curly apostrophe—which looks identical to an ending quotation mark: ’.

Just look when I write them after each other:

1: right single quotation mark entity, 2: apostrophe entity: ’ '.

I tried to find a proper entity or alt command specifically for a normal looking apostrophe (which again, looks ‘identical’ to a closing right single quotation mark), but I haven’t found one. I always need to insert a right single quotation mark in order to get the visually correct apostrophe.

If you use just ’ (ALT + 0146) or autoformat typewriter apostrophes and quotation marks as curly in a word processor like Word 2013, do use .

I've found FileFormat.info's Unicode Character Search to be most helpful in finding exact character codes.

Entering simply ' (the character to the left of the return key on my US Mac keyboard) into their search yields several results of various curls and languages.

I would presume the original question was asking for the typographically correct U+02BC ʼ, rather than the typewriter fascimile U+0027 '.

The W3C recommends hex codes for HTML entities (see below). For U+02BC that would be ʼ, rather than ' for U+0027.

Using character escapes in markup and CSS

Hex vs. decimal. Typically when the Unicode Standard refers to or lists characters it does so using a hexadecimal value. … Given the prevalence of this convention, it is often useful, though not required, to use hexadecimal numeric values in escapes rather than decimal values…

5 HTML Document Representation … 5.4 Undisplayable characters

…If missing characters are presented using their numeric representation, use the hexadecimal (not decimal) form, since this is the form used in character set standards.

Just a one more link with nicely maintained collection Html Entities

As far as I know it is ' but it seems yours works as well

Use ' for a straight apostrophe. This tends to be more readable than the numeric ' (if others are ever likely to read the HTML directly).

Edit: msanders points out that ' isn't valid HTML4, which I didn't know, so follow most other answers and use '.

You can try ' as seen in http://unicodinator.com/#0027

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值