惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
雷峰网
雷峰网
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Spread Privacy
Spread Privacy
H
Hacker News: Front Page
PCI Perspectives
PCI Perspectives
Webroot Blog
Webroot Blog
罗磊的独立博客
H
Heimdal Security Blog
TaoSecurity Blog
TaoSecurity Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
大猫的无限游戏
大猫的无限游戏
月光博客
月光博客
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Google Online Security Blog
Google Online Security Blog
Last Week in AI
Last Week in AI
美团技术团队
Help Net Security
Help Net Security
The Hacker News
The Hacker News
C
Cisco Blogs
T
The Blog of Author Tim Ferriss
J
Java Code Geeks
The Register - Security
The Register - Security
IT之家
IT之家
WordPress大学
WordPress大学
Jina AI
Jina AI
Recent Commits to openclaw:main
Recent Commits to openclaw:main
H
Help Net Security
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
T
Threat Research - Cisco Blogs
P
Proofpoint News Feed
NISL@THU
NISL@THU
爱范儿
爱范儿
The GitHub Blog
The GitHub Blog
Scott Helme
Scott Helme
V
Vulnerabilities – Threatpost
B
Blog
T
Tenable Blog
博客园 - 三生石上(FineUI控件)
T
The Exploit Database - CXSecurity.com
S
Security Affairs
小众软件
小众软件
Hacker News: Ask HN
Hacker News: Ask HN
Security Latest
Security Latest
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
W
WeLiveSecurity
A
Arctic Wolf
L
LINUX DO - 热门话题
Google DeepMind News
Google DeepMind News
M
MIT News - Artificial intelligence

博客园 - ;姚元培

C#企业级开发案例精解:用经典案例学通 NET技术 NHibernate HibernateTemplate 和Session的区别 HQL中的Like查询需要注意的地方 C# WinForm控件美化扩展系列之TabControl控件(3)-完整版 应用程序权限设计 asp.net MVC 显示数据库中的html 代码 ASP.NET MVC2 使用绑定时 等号和冒号的差别 spring.net asp.net mvc 验证 asp.net防止页面刷新或后退引起重复提交 截获系统注销时候的消息 WeifenLuo.WinFormsUI.DockContent 使用 c# listview 房间列表 百度搜索 asp后台批处理 asp.net数据显示 完善网站程序 脚本攻击防范策略完全篇 asp获取客户端ip http-equiv属性 弹出窗口代码 asp sql语句 javascript with 和 prototype属性 .NET设计模式系列文章 关于rs.bof 和 rs.eof onbeforeunload与onunload事件 使用distinct在mysql中查询多条不重复记录值的解决办法 屏幕捕捉 和批量重名命 html文件 后缀 js dom JavaScrip高级应用:操作模态与非模态对话框 vb常用 如何去除图片连接的边框线 常用CHM帮助文档集锦下载 asp 纪录集 返回首行首列 SQL语句大全 正则表达式30分钟入门教程
HTML特殊字符显示
;姚元培 · 2011-12-16 · via 博客园 - ;姚元培

 HTML特殊字符显示


  HTML字符实体(Character Entities)

有些字符在HTML里有特别的含义 ,比如小于号<就表示HTML Tag的开始,这个小于
号是不显示在我们最终看到的网页里的。那如果我们希望在网页中显示一个小于
号,该怎么办呢?

这就要说到HTML字符实体(HTML Character Entities)了。

一个字符实体(Character Entity)分成三部分 :第一部分是一个&符号,英文叫
ampersand;第二部分 是实体 (Entity)名字或者是#加上实体(Entity)编号;第三
部分是一个分号。

=====天王盖地虎 宝塔镇河妖=====Entity是区分大小写的。这就要说到HTML字符
实体(HTML !

比如,要显示小于号,就可以写 &lt;或者&#60;。

用实体(Entity)名字的好处是比较好理解 ,一看lt,大概就猜出是less than的意
思,但是其劣势在于并不是所有的浏览器都支持最新的Entity名字。而实体
(Entity)编号,各种浏览器都能处理。

=====天王盖地虎 宝塔镇河妖 =====有些字符在HTML里有特别的含义,比如小于号?

注意 :Entity是区分大小写的。


  如何显示空格

通常情况下,HTML会自动截去多余的空格。不管 你加多少空格,都被看做一个空
格 。比如你在两个字之间加了10个空格,HTML会截去9个空格,只保留一个。为了
在网页中增加空格,你可以使用&nbsp;表示空格。


  最常用的字符实体(Character Entities )

显示结果  说明  Entity Name  Entity Number
 显示一个空格  &nbsp;  &#160;
<  小于  &lt;  &#60 ;
>  大于  &gt;  &#62;
&  &符号  &amp;  &#38 ;
"  双引号  &quot;  &#34;


  其他常用的字符实体(Character Entities)

显示结果  说明  Entity Name  Entity Number
&#169;  版权  &copy ;  &#169;
&#174;  注册商标  &reg;  &#174;
×  乘号  &times;  &#215 ;
÷  除号  &divide ;  &#247 ;


  更多字符实体(Character Entities