Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS

Why when we make an <p> element sometimes the teachers uses something like & amp; inside the paragraph

Why when we make an <p> element sometimes the teachers uses something like & amp; inside the paragraph

Jeff Kinley
Jeff Kinley
21,207 Points

These are called HTML entities. For more info, check this out:

https://www.tutorialspoint.com/html/html_entities.htm

2 Answers

Steven Parker
Steven Parker
220,450 Points

There are some Unicode characters, sometimes called "HTML symbol entities", that are represented in HTML using a group of characters. These groups begin with an ampersand ("&") and end with a semicolon (";") and have an abbreviated name or a number code in between.

Since the ampersand is used to identify such sequences, it has a code itself, which is "&amp;". So anytime you wish an ampersand to be seen you must use that code in your text.

Click on this link for a descriptive page with a table of the more common codes, and this one has more comprehensive table.

Thanks Steven Parker