user94154
user94154

Reputation: 16584

Infinity symbol with HTML

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

infinity symbol

Upvotes: 193

Views: 123032

Answers (9)

arjun
arjun

Reputation: 1203

Infinity is a reserved character in HTML. Following are its values in various forms.

  • Hex : 8734
  • Decimal : 221E
  • Entity : ∞

To use in html code

<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

Upvotes: 3

Kaiden Prince
Kaiden Prince

Reputation: 472

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

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:

.infinity-ico:before {
    content: '\221E';
}

Upvotes: 4

According to this page, it's &infin;.

Upvotes: 6

Gumbo
Gumbo

Reputation: 655785

You can use the following:

  • literal: (if the encoding you use can encode it — UTF-8 can, for example)
  • character reference: &#8734; (decimal), &#x221E; (hexadecimal)
  • entity reference: &infin;

But whether it is displayed correctly does also depend on the font the text is displayed with.

Upvotes: 116

Matthew Flaschen
Matthew Flaschen

Reputation: 285057

This does not require a HTML entity if you are using a modern encoding (such as UTF-8). And if you're not already, you probably should be.

Upvotes: 27

Gregoire
Gregoire

Reputation: 24872

&#8734;

Upvotes: 6

brad
brad

Reputation: 75504

From Wikipedia:

&infin;

Upvotes: 10

ЯegDwight
ЯegDwight

Reputation: 25257

Use the HTML entity &infin; or &#8734;.

Upvotes: 350

Related Questions