带有 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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 02:11:18  来源:igfitidea点击:

Infinity symbol with HTML

htmlhtml-entitiesinfinity

提问by user94154

How can I display an infinity symbol (like the one in the picture) using HTML?

如何使用 HTML 显示无穷大符号(如图片中的那个)?

infinity symbol

infinity symbol

回答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 brad

From Wikipedia:

来自维基百科

∞

回答by FrustratedWithFormsDesigner

According to this page, it's ∞.

根据这个页面,它是∞

回答by Gregtheitroade

∞

∞

回答by Kaiden Prince

Like ЯegDwight said, you can use the HTML entity ∞ or ∞. A easy source of getting these codes, is to look at this entity list.

就像 ЯegDwight 所说的,你可以使用 HTML 实体∞或∞。获取这些代码的一个简单来源是查看此实体列表

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 &#8734; </p>
<p>The html symbol is &#x221E; </p>
<p>The html symbol is &infin; </p>

Reference : HTML Symbols- HTML Infinity Symbol

参考:HTML 符号- HTML 无限符号