Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

html

What is an ampersand in HTML?

Shahpar Khan

What is an HTML entity?

HTML has reserved some characters to serve as a part of its syntax. For example, < and > signs are reserved for tags. To print these reserved characters in your text, you need to use an ampersand before them, followed by the entity name or the entity number. Here is how you print a < and > signs in your text:

Symbol Entity Name Entity Number
< &lt &#60
> &gt &#62

One would naturally wonder, “If ampersand is used to print different special characters, how will we print the & sign?”.

The answer to this is, a separate entity name and entity number are used to print &.

Symbol Entity Name Entity Number
& &amp &#38

Below is a sample of how to incorporate & into your HTML text:

RELATED TAGS

html

CONTRIBUTOR

Shahpar Khan
Copyright ©2022 Educative, Inc. All rights reserved
RELATED COURSES

View all Courses

Keep Exploring