0% found this document useful (0 votes)
27 views

HTML Entities Codecademy

Ghcxbbn

Uploaded by

John Ibe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views

HTML Entities Codecademy

Ghcxbbn

Uploaded by

John Ibe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

HTML Concepts →

Docs / HTML / Entities

Entities
+1

Published Mar 22, 2022 • Updated Oct 11, 2023

Contribute to Docs

Entities are character sequences placed in the


text of an HTML document to print out reserved
characters which may otherwise be interpreted
as HTML code by a browser, or other special
characters that would be di!cult to generate
with a typical keyboard. In fact, using reference
numbers, an entity can represent any Unicode
character. When parsing the HTML, a browser
replaces the entity’s character sequence with
the character it represents.

Syntax
Entities are case-sensitive and can take one of
three forms.

The "rst form references an entity by name:

&name;

The second form references it by the decimal


Unicode number:

&#number;

The third represents it with the hexadecimal


Unicode number, often with leading zeros:

&#xnumber;

So the copyright entity ( © ) can be represented


as © , &#169 or © .

Entity Values
There are many HTML entities. The following are
some common ones:

2nd
Entity Name 1st Form 3rd Form
Form
Non-breaking
     
space
Less-than sign
< < <
<
Greater-than
&gt; &#62; &#x0003E;
sign >
Ampersand & &amp; &#38; &#x00026;

Quote " &quot; &#34; &#x00022;

Apostrophe ' &apos; &#39; &#x00027;

Copyright © &copy; &#169; &#x000A9;

Degree ° &deg; &#176; &#x000B0;

Euro € &euro; &#8364; &#x020AC;


Bullet
&bullet; &#8226; &#x02022;
character •

More can be found in this extensive HTML 5


entity reference.

The Tab Entity


There is an entity &Tab; (or &#9; ) which
nominally produces a tab character. However, it
will not behave as expected because HTML
collapses whitespace where it appears in text
with the exception of the non-breaking space
entity, &nbsp; . So to render a tab in HTML text,
it needs to be wrapped within a <pre> tag to
preserve the whitespace.

<p>The tab entity &Tab; in this sentence

<pre>
<p>The tab entity &Tab; in this sentenc
</pre>

Output:

Alternatively, four &nbsp; entities can be used.

<p>The Tab entity &Tab; in this sentence

<p>The spaces &nbsp;&nbsp;&nbsp;&nbsp; in

Entities

Greek Symbols
Used in scienti"c, mathematical, and
technological applications.

All contributors
@StevenSwinia… @Conor12_

Looking to contribute?
Learn more about how to get involved.

Edit this page on GitHub to "x an error


or make an improvement.

Submit feedback to let us know how we


can improve Docs.

Learn HTML on Codecademy

Career path

Front-End Engineer
Front-end engineers work closely with designers to
make websites beautiful, functional, and fast.

Includes 34 Courses

With Professional Certi"cation

Beginner Friendly 115 hours

Free course

Learn HTML
Start at the beginning by learning HTML basics — an
important foundation for building and editing web
pages.

Beginner Friendly 7 hours

Back to top

Company Plans

For individuals
About
For students
Careers
For teams
A!liates
Discounts

Community

Resources Clubs

Articles Code Crew

Blog Discord

Cheatsheets Events

Code challenges Forums

Docs Learner Stories

Projects

Videos

Workspaces

Support

Help Center

Subjects Languages

AI Bash

Cloud Computing C

Code Foundations C++

Computer Science C#

Cybersecurity Go

Data Analytics HTML & CSS

Data Science Java

Data Visualization JavaScript

Developer Tools Kotlin

DevOps PHP

Game Development Python

IT R

Machine Learning Ruby

Math SQL

Mobile Development Swift

Web Design

Web Development

Career building Mobile

Career paths

Career center

Interview prep

Professional certi"cation

Compare to bootcamps

Full Catalog

Beta Content

Roadmap

Privacy Policy | Cookie Policy |


Do Not Sell My Personal Information | Terms

Made with in NYC © 2024 Codecademy

You might also like