文本复选框“?”的 HTML 代码
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4041720/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
HTML Code for text checkbox '?'
提问by Thomas
Is there an HTML code for the text checkbox '?'?
文本复选框“?”是否有 HTML 代码?
EDIT: So to be clear, I need the HTML Number for the symbol ?, not the form element checkbox.
编辑:所以要清楚,我需要符号的 HTML 编号?,而不是表单元素复选框。
回答by bobince
U+F0FE ?
is not a checkbox, it's a Private Use Area character that might render as anything. Whilst you can certainly tryto include it in an HTML document, either directly in a UTF-8 document, or as a character reference like 
, you shouldn't expect it to render as a checkbox. It certainly doesn't on any of my browsers—although on some the ‘unknown character' glyph is a square box that at least looks similar!
U+F0FE?
不是一个复选框,它是一个可以呈现为任何东西的私人使用区域字符。虽然您当然可以尝试将它包含在 HTML 文档中,或者直接包含在 UTF-8 文档中,或者作为像 的字符引用
,但您不应该期望它呈现为复选框。它在我的任何浏览器上都没有——尽管在某些“未知字符”字形上是一个至少看起来相似的方框!
So where does U+F0FE come from? It is an unfortunate artifact of Word RTF export where the original document used a symbol font: one with no standard mapping to normal unicode characters; specifically, in this case, Wingdings. If you need to accept Word RTF from documents still authored with symbol fonts, then you will need to map those symbol characters to proper Unicode characters. Unfortunately that's tricky as it requires you to know the particular symbol font and have a map for it. See this postfor background.
那么U+F0FE从何而来?这是 Word RTF 导出的一个不幸的产物,其中原始文档使用了一种符号字体:一种没有标准映射到普通 unicode 字符的字体;具体来说,在这种情况下,Wingdings。如果您需要从仍然使用符号字体创作的文档中接受 Word RTF,那么您需要将这些符号字符映射到正确的 Unicode 字符。不幸的是,这很棘手,因为它需要您知道特定的符号字体并为其绘制地图。有关背景,请参阅此帖子。
The standardised Unicode characters that best represent a checkbox are:
最能代表复选框的标准化 Unicode 字符是:
?
, U+2610 Ballot box?
, U+2611 Ballot box with check
?
, U+2610 投票箱?
, U+2611 带支票的投票箱
If you don't have a Unicode-safe editor you can naturally spell them as ☐
and ☑
.
如果您没有 Unicode 安全的编辑器,您自然可以将它们拼写为☐
and ☑
。
(There is also U+2612 using an X, ?
.)
(还有 U+2612 使用 X, ?
。)
回答by nonopolarity
This will do:
这将:
▢
It is ?
(known as a "WHITE SQUARE WITH ROUNDED CORNERS" on fileformat.info)
这是 ?
(在fileformat.info上称为“带圆角的白色正方形” )
Or
或者
◻
as ?
(known as a "WHITE MEDIUM SQUARE" on the same website)
作为 ?
(在同一网站上称为“白色中型广场”)
Two with shadow:
两个带阴影:
❏
❑
as ? and ? . The difference between them is the shadows' shape. You can see it if you zoom in or if you print it out. (They are known as "LOWER RIGHT DROP-SHADOWED WHITE SQUARE" and "LOWER RIGHT SHADOWED WHITE SQUARE", respectively).
作为 ?和 ?. 它们之间的区别在于阴影的形状。如果放大或打印出来,您可以看到它。(它们分别被称为“右下阴影白色正方形”和“右下阴影白色正方形”)。
You can also use
你也可以使用
☐
which is ?
(known as a "BALLOT BOX").
哪个是?
(称为“投票箱”)。
A sample is at http://jsfiddle.net/S2QCt/267/
示例位于 http://jsfiddle.net/S2QCt/267/
(a note: on the Mac, ▢
is quite nice, because it is bigger and somewhat more elegant than ☐
On Windows, ☐
looks more standard, while ▢
is somewhat small.)
(注:在 Mac 上,▢
相当不错,因为它比☐
在 Windows 上更大更优雅,☐
看起来更标准,而▢
有点小。)
回答by Juan Barradas
Use the Unicode Character
使用 Unicode 字符
✔ = ✔
✔ = ✔
回答by Abdennour TOUMI
?
?
this is a character . You can do copy/past without problem
这是一个性格。您可以毫无问题地进行复制/过去
回答by Federico klez Culloca
This is the code for the character you posted in your question: 
这是您在问题中发布的字符的代码: 
But that's not a checkbox character...
但这不是复选框字符...
回答by RoToRa
Just make sure that your HTML file is encoded with UTF-8 and that your web server sends a HTTP header with that charset, then you just can write that character directly into your HTMl file.
只需确保您的 HTML 文件使用 UTF-8 编码,并且您的 Web 服务器发送带有该字符集的 HTTP 标头,然后您就可以将该字符直接写入您的 HTMl 文件中。
http://www.w3.org/International/O-HTTP-charset
http://www.w3.org/International/O-HTTP-charset
If you can't use UTF-8 for some reason, you can look up the codes in a unicode list such as http://en.wikipedia.org/wiki/List_of_Unicode_charactersand use ꯍ
where ABCD is the hexcode from that list (U+ABCD).
如果由于某种原因您不能使用 UTF-8,您可以在 unicode 列表中查找代码,例如http://en.wikipedia.org/wiki/List_of_Unicode_characters并使用ꯍ
其中 ABCD 是该列表中的十六进制代码(U +ABCD)。
回答by Alen Siljak
As this has already been properly answered, I'd just add the following site as a reference:
由于这已经得到正确回答,我只是添加以下站点作为参考:
You can search for "check", for example.
例如,您可以搜索“检查”。