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 CSS Layout Techniques Flexbox Layout Animating Flexbox

David Service
David Service
12,928 Points

Inserting HTML Entities

When Guil inserts the HTML entities in his markup, why is it formatted "&#xe602" instead of "&#602"? What is the difference?

3 Answers

Logan R
Logan R
22,989 Points

They are the same thing, but the first number is an HTML entity while the second is a Unicode.

http://www.htmlescape.net/e6/character_e602.html

Edit: But he is also using a custom font, so I am not sure on the rules of that.

Wayne Priestley
Wayne Priestley
19,579 Points

Hi David,

Sometimes there is more than one way to type the code and get the same results e.g. to get an ampersand you could type the Entity name & or you could type the Entity number &

Both will give you the correct symbol.

Hope this helps.

Edit: Logan beat me to it :)

David Service
David Service
12,928 Points

Hi Guys,

Thanks for the quick responses! What I was specifically confused about the hexadecimal notation and how it worked.

So from what I understand, an HTML entity can take the form of a name, number (using the "&#" notation), and a third notation ("&#x"); I'm just wondering what the third notation is, and when/why we would use it.

I may be missing something really obvious here, but any help is appreciated.

Thanks again,

David

David Service
David Service
12,928 Points

Just figured it out! I took Logan's answer, looking for ways that unicode is applied to web, and found this:

http://en.wikipedia.org/wiki/Unicode#Web

Thanks again, guys.