Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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
229,708 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