HTML标记以防止HTML标记被执行? [英] HTML tag to prevent HTML tags to be executed?

查看:143
本文介绍了HTML标记以防止HTML标记被执行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想到的超级用户问的基本问题,但我认为这是一个编程问题。我刚开始学习HTML,所以请耐心等待。



如何防止程序解释HTML标记/语法? 例如,我想写一个像这样的闪存卡:


<$ c $








$& p>我想要一个适用于任何或大多数语法的解决方案,不仅适用于<



如何输入语法(不带任何空格)以确保代码不被解释? 你打算必须手动完成。



此处你有完整的编码表。最常用的代码是:

 字符实体编号实体名称描述
&#34;& quot; quot ;引号
'&#39;&''撇号(在IE中不起作用)
&&#38;& amp& amp; amp& amp; amp;
& amp; amp; amp; amp; amp; amp; 60;<小于
&#62;& gt;大于


Basic question which I thought of asking on Superuser, but it is a programming question I think. I just started learning HTML, so please bear with me.

How can I prevent a program from interpreting an HTML tag / syntax? For example, I want to write a flash card like this:

The html code for < is &lt;

I would like a solution that would work for any or most syntax, not just for <.

How can I enter the syntax (without any space) to make sure the code isn't interpreted?

解决方案

You are going to have to do it manually.

Here you have the full encoding table. The most commonly used codes are:

Character  Entity Number  Entity Name  Description
"          &#34;          &quot;       quotation mark
'          &#39;          &apos;       apostrophe (does not work in IE)
&          &#38;          &amp;        ampersand
<          &#60;          &lt;         less-than
>          &#62;          &gt;         greater-than

这篇关于HTML标记以防止HTML标记被执行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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