HTML实体和Unicode字符

There are two primary methods of generating a character with HTML entities: that is, two ways of generating characters that your keyboard and/or a word processor does not produce by default. Both methods start with an ampersand character (&) and end with a semi-colon. They are keyword and decimal entities.

有两种使用HTML实体生成字符的主要方法:即,两种默认情况下键盘和/或文字处理器不会生成的字符生成方法。 两种方法都以&字符开头,以分号结尾。 它们是关键字十进制实体。

关键字实体 (Keyword entities)

Keyword entities cover the most common characters, and are recognized by the majority of browsers. A few examples:

关键字实体涵盖了最常见的字符,并且被大多数浏览器所识别。 一些例子:

Keyword HTML entities
KeywordMeaningProduces
©copyright symbol©
™trademark symbol
°degree°
—a long dash – to separate two conjoined pieces of text
–a short dash or hyphen - to join words or dates (e.g. 1939-45)
“a leading quotation mark
”a closing quotation mark
″inches, seconds
′feet, minutes
¾three-quarters¾
关键字HTML实体
关键词 含义 产生
© 版权符号 ©
™ 商标符号
° °
— 一个长破折号–分隔两个相连的文本
– 短破折号或连字符-连接单词或日期(例如1939-45)
“ 前导引号
” 右引号
″ 英寸,秒 ''
′ 英尺,分钟
¾ 四分之三 ¾

十进制实体 (Decimal entities)

Not every character has a keyword entity: the number of possible characters and symbols from every language is simply too great. Every character is also given a decimal entity: a code written in numbers. Sometimes these have keyword entity equivalents, but often not. Successful glyph representation is often more sensitive to font, browser, and OS selection. A minute sampling:

并非每个字符都有一个关键字实体:每种语言可能包含的字符和符号的数量太多了。 每个字符还具有一个十进制实体:用数字编写的代码。 有时这些具有关键字实体等效项,但通常没有。 成功的字形表示通常对字体,浏览器和OS选择更为敏感。 一分钟采样:

Decimal HTML entities
CodeMeaningProduces
↺open circle clockwise arrow
⇨right white arrow
⅗vulgar fraction, three-fifths
№numero sign
Ωohm
十进制HTML实体
含义 产生
↺ 空心圆顺时针箭头
⇨ 右白色箭头
⅗ 低俗分数,五分之三
№ 数字符号
Ω 欧姆 Ω

一些奇怪的地方 (A few oddities)

There are a few characters that remain problematic. The first two are the greater and less than sign: when you use < or > in a web page, the browser will assume that you are starting about the start or end of a tag. Use the keyword entities &lt; and &gt; to create those.

有些字符仍然有问题。 前两个是大于号和小于号:当您在网页中使用<或>时,浏览器将假定您是从标签的开头或结尾开始的。 使用关键字实体&lt;&gt; 创建那些。

The last is the ampersand character, for similar reasons: if you have an & in your document, the browser assumes you are about to start an HTML entity. You have a keyword entity for that too: &amp;

出于相似的原因,最后一个是&字符:如果文档中有&,浏览器会假定您将要启动HTML实体。 您也有一个关键字实体: &amp;

资源资源 (Resources)

There are many good resources for HTML entities and Unicode characters:

有关HTML实体和Unicode字符的好资源很多:

  • EntityCode is a useful resource for common entities, as is nice entity.

    EntityCode是常见的实体有用的资源,如漂亮的实体

  • The FileFormat.info site has an exhaustive list of Unicode characters, including everything you would never want to know about them.

    FileFormat.info网站上有Unicode字符的详尽列表,包括您永远不希望了解的所有字符。

  • Dan Short also has an excellent list of popular graphical HTML entities.

    丹·肖特(Dan Short)也列出了流行HTML图形实体

  • If you want to go directly to the source, Unicode.org has a massive series of character charts, in PDF, so you can see what a character should be without worrying about fonts or browser compatibility.

    如果您想直接访问源代码, Unicode.org有大量的PDF字符表系列,因此您可以查看字符应该是什么,而不必担心字体或浏览器的兼容性。

  • Another useful Unicode table for common characters

    另一个有用的通用字符Unicode表

  • LeftLogic has an HTML Entity Lookup, which is also available as a Dashboard widget for Mac OS X.

    LeftLogic具有HTML实体查找,也可以作为Mac OS X的“仪表板”小部件使用。

  • ShapeCatcher helps you find Unicode glyphs by matching possible characters to your drawn sketches.

    ShapeCatcher通过将可能的字符匹配到绘制的草图来帮助您找到Unicode字形。

  • The Unicode Symbol Map is a browser bookmarklet that helps you find common symbols.

    Unicode符号映射是一个浏览器书签,可帮助您查找常见符号。

  • The excellent Unify by John Holt Ripley has a very good comparison of cross-browser and platform Unicode symbol support.

    John Holt Ripley 撰写的出色的《 Unify》对跨浏览器和平台Unicode符号支持进行了很好的比较。

翻译自: https://thenewcode.com/207/HTML-Entities-and-Unicode-Characters

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值