In this HTML lesson, we show the many types of HTML entities that can be used. First, we recall that we introduced the non-breaking space as a way to insert spaces of various lengths into text. Next, we show some basic mathematics related entities that can be used in common formulas. Then we present some entities can be used as alternatives to the superscript element. After that, we note that entities exist for most any language in the world. Furthermore, we have entities for various types of games and all of the common alpha-numeric keys on the keyboard.
We were introduced to our first entity in the last lesson, and that was the non-breaking space. The non-breaking space can be used to make spaces of various sizes within any text element. Here, we show several lines of text with each one indented by an extra non-breaking space.
<!DOCTYPE html> <html> <head> <title>XoaX.net HTML</title> </head> <body> <p> But the righteous man, though he die early, will be at rest.<br /> For old age is not honored for length of time,<br /> nor measured by number of years;<br /> but understanding is gray hair for men,<br /> and a blameless life is ripe old age.<br /> </p> </body> </html>
Entities exist for common mathematics usage. In this example, we use the entities for the Greek letter theta, the fraction one-half, the multiplication symbol, and the division symbol.
<!DOCTYPE html> <html> <head> <title>XoaX.net HTML</title> </head> <body> <p>sin(θ) = ½</p> <p>3 × 4 = 24 ÷ 2</p> </body> </html>
Entities can be used as alternatives to some elements. Here, we show two ways to encoded an exponent: with an entity or with an element. We also use the entity for the Greek letter pi.
<!DOCTYPE html> <html> <head> <title>XoaX.net HTML</title> </head> <body> <h1>The Area of a Circle</h1> <p>A = πr²</p> <p>A = πr<sup>2</sup></p> </body> </html>
Entities can be used to encode the alphabets of most any language in the world. In this example, we have encoded a couple of characters from German.
<!DOCTYPE html> <html> <head> <title>XoaX.net HTML</title> </head> <body> <h1>Language Entities</h1> <p>Ich heiße Johann Wolfgang von Göthe.</p> </body> </html>
Entities are available for many common classic games: chess, checkers, dominos, etc. In this example, we encode the four playing card suits in three different ways. All entites have a numeric specifications, which we can give in decimal or hexadecimal, as shown. For the more common entities, we also have a name specification.
<!DOCTYPE html> <html> <head> <title>XoaX.net HTML</title> </head> <body> <h1>Card Suits</h1> <hr /> <h1>Names: ♠ ♣ ♥ ♦</h1> <h1>Decimal: ♠ ♣ ♥ ♦</h1> <h1>Hexadecimal: ♠ ♣ ♥ ♦</h1> <hr /> <h1>Cards: 🂡 🂥 🂪</h1> </body> </html>
Entities exist for almost any symbol in mathemtics or music. Additionally, we have entities for common characters. These are especially useful for encoding characters that might be mistaken for HTML, like the less than and greater than symbols. In this example, we encode the code for the zero entity and the quotation element for demonstration.
<!DOCTYPE html> <html> <head> <title>XoaX.net HTML</title> </head> <body> <h1>Music: 𝄞 𝅘𝅥 𝄽 𝄰</h1> <h1>Mathematics: ℤ ∠ ∫ ∀ ∈</h1> <h1>Ordinary Text: & # x 3 0 > ;</h1> <h1>The entity code for 0 is &#x30;</h1> <h1><q>Hello</q> is coded like this: <q>Hello</q></h1> </body> </html>
© 20072025 XoaX.net LLC. All rights reserved.