Alex Rivera | Logout

Escape tags in HTML

Asked 2009-03-28T03:26:26.670
52

What are escape tags in HTML?

Are they &#34; &#60; &#62; to represent " < >? And how do these work?

Is that hex, or what is it?

How is it made, and why aren't they just the characters themselves?

Edit
Report

1 Answer

37

How do these work?

Anything &#num; is replaced with character from ASCII table, matching that num.

Is that hex, or what is it?

It's not hex, the number represents characters number in decimal in ASCII table. Check out ASCII table. Check Dec and HTML columns.

Why aren't they just the characters themselves?

Look at this example:

<div>Hey you can use </div> to end div tag!</div>

It would mess up the interpreter. It's a bad example, but you got the idea.

Why you can't use escape characters like in programming languages?

I don't have exact answer to that. But html same as xml is a markup language and not programming language and answer probably lies within history of how markup languages become what they are now.

answered 2009-03-28T03:35:57.867

Your Answer