带有 HTML 的无穷大符号
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2254913/
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
Infinity symbol with HTML
提问by user94154
How can I display an infinity symbol (like the one in the picture) using HTML?
如何使用 HTML 显示无穷大符号(如图片中的那个)?
回答by ЯegDwight
Use the HTML entity ∞
or ∞
.
使用 HTML 实体∞
或∞
.
回答by Gumbo
You can use the following:
您可以使用以下内容:
- literal:
∞
(if the encoding you use can encode it — UTF-8 can, for example) - character reference:
∞
(decimal),∞
(hexadecimal) - entity reference:
∞
- 文字:(
∞
如果您使用的编码可以对其进行编码 - 例如 UTF-8 可以) - 字符参考:(
∞
十进制)、∞
(十六进制) - 实体参考:
∞
But whether it is displayed correctly does also depend on the font the text is displayed with.
但是它是否正确显示还取决于文本显示的字体。
回答by Matthew Flaschen
∞
∞
This does notrequire a HTML entity if you are using a modern encoding (such as UTF-8). And if you're not already, you probably should be.
这并没有,如果你使用的是最新的编码(如UTF-8)需要一个HTML实体。如果你还没有,你可能应该是。
回答by artlung
回答by Gregtheitroade
∞ ∞
∞ ∞
回答by Kaiden Prince
Like ЯegDwight said, you can use the HTML entity &infin
; or ∞
. A easy source of getting these codes, is to look at this entity list.
就像 ЯegDwight 所说的,你可以使用 HTML 实体&infin
;或∞
。获取这些代码的一个简单来源是查看此实体列表。
You can also use them in CSS, which was what I was looking for, just like font-awesome does. A simple CSS based solution would be to have something like:
你也可以在 CSS 中使用它们,这正是我想要的,就像 font-awesome 一样。一个简单的基于 CSS 的解决方案是:
.infinity-ico:before {
content: '1E';
}
回答by Mallikarjun M
Infinity is a reserved character in HTML. Following are its values in various forms.
Infinity 是 HTML 中的保留字符。以下是其各种形式的值。
- Hex : 8734
- Decimal : 221E
- Entity : ∞
- 十六进制:8734
- 十进制:221E
- 实体:∞
To use in html code
在 html 代码中使用
<p>The html symbol is ∞ </p>
<p>The html symbol is ∞ </p>
<p>The html symbol is ∞ </p>
Reference : HTML Symbols- HTML Infinity Symbol