在html中转义标签 [英] Escape tags in html

查看:229
本文介绍了在html中转义标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

html中的转义标记是什么?

What are escape tags in html?

他们是&#34; &安培;#60; &#62; 表示,< $>
这些工作如何?这是十六进制还是它是什么,它是怎么做的,为什么不

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?

推荐答案

这些工作如何工作?

Anything& #num;被替换为与该数字匹配的ASCII表的字符。

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

是十六进制还是它是什么?

不是十六进制,数字表示ASCII表中的十进制数字,请查看 ASCII表检查Dec和HTML列。

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?

看这个例子:

<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.

为什么你不能使用编程语言中的转义字符?

我没有确切的答案。但是,与xml相同的HTML是一种标记语言,而不是编程语言和答案可能在于标记语言如何成为现在的历史。

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.

这篇关于在html中转义标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆