博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
HTML - HTML Commonly Used Character Entities
阅读量:6975 次
发布时间:2019-06-27

本文共 6233 字,大约阅读时间需要 20 分钟。

HTML Entities

Some characters are reserved in HTML.

It is not possible to use the less than (<) or greater than (>) signs in your text, because the browser will mix them with tags.

To actually display reserved characters, we must use character entities in the HTML source code.

A character entity looks like this:

&
entity_name;

OR

&#
entity_number;

To display a less than sign we must write: &lt; or &#60;

Remark Tip: The advantage of using an entity name, instead of a number, is that the name is easier to remember. However, the disadvantage is that browsers may not support all entity names (the support for entity numbers is very good).


Non-breaking Space

A common character entity used in HTML is the non-breaking space (&nbsp;).

Browsers will always truncate spaces in HTML pages. If you write 10 spaces in your text, the browser will remove 9 of them, before displaying the page. To add spaces to your text, you can use the &nbsp; character entity.


HTML Entities Example

Experiment with HTML character entities: 


HTML Useful Character Entities

Note: Entity names are case sensitive!

Result Description Entity Name Entity Number
  non-breaking space &nbsp; &#160;
< less than &lt; &#60;
> greater than &gt; &#62;
& ampersand &amp; &#38;
? cent &cent; &#162;
?

pound &pound; &#163;
?

yen &yen; &#165;
?

euro &euro; &#8364;
§ section &sect; &#167;
? copyright &copy; &#169;
? registered trademark &reg; &#174;
? trademark &trade; &#8482;

For a complete reference of all character entities, visit our .

HTML ISO-8859-1 Reference


Modern browsers supports several character-sets:


ISO-8859-1

ISO-8859-1 is the default character set in most browsers.

The first 128 characters of ISO-8859-1 is the original ASCII character-set (the numbers from 0-9, the uppercase and lowercase English alphabet, and some special characters).

The higher part of ISO-8859-1 (codes from 160-255) contains the characters used in Western European countries and some commonly used special characters.

Entities are used to implement reserved characters or to express characters that cannot easily be entered with the keyboard.


Reserved Characters in HTML

Some characters are reserved in HTML and XHTML. For example, you cannot use the greater than or less than signs within your text because the browser could mistake them for markup.

HTML and XHTML processors must support the five special characters listed in the table below:

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

Note: Entity names are case sensitive!


ISO 8859-1 Symbols

Character Entity Number Entity Name Description
  &#160; &nbsp; non-breaking space
? &#161; &iexcl; inverted exclamation mark
? &#162; &cent; cent
? &#163; &pound; pound
¤ &#164; &curren; currency
? &#165; &yen; yen
? &#166; &brvbar; broken vertical bar
§ &#167; &sect; section
¨ &#168; &uml; spacing diaeresis
? &#169; &copy; copyright
? &#170; &ordf; feminine ordinal indicator
? &#171; &laquo; angle quotation mark (left)
? &#172; &not; negation
  &#173; &shy; soft hyphen
? &#174; &reg; registered trademark
? &#175; &macr; spacing macron
° &#176; &deg; degree
± &#177; &plusmn; plus-or-minus 
? &#178; &sup2; superscript 2
?

&#179; &sup3; superscript 3
?

&#180; &acute; spacing acute
? &#181; &micro; micro
?

&#182; &para; paragraph
· &#183; &middot; middle dot
?

&#184; &cedil; spacing cedilla
?

&#185; &sup1; superscript 1
?

&#186; &ordm; masculine ordinal indicator
? &#187; &raquo; angle quotation mark (right)
? &#188; &frac14; fraction 1/4
?

&#189; &frac12; fraction 1/2
?

&#190; &frac34; fraction 3/4
? &#191; &iquest; inverted question mark
× &#215; &times; multiplication
÷ &#247; &divide; division

ISO 8859-1 Characters

Character Entity Number Entity Name Description
? &#192; &Agrave; capital a, grave accent
?

&#193; &Aacute; capital a, acute accent
? &#194; &Acirc; capital a, circumflex accent
? &#195; &Atilde; capital a, tilde
? &#196; &Auml; capital a, umlaut mark
?

&#197; &Aring; capital a, ring
? &#198; &AElig; capital ae
?

&#199; &Ccedil; capital c, cedilla
?

&#200; &Egrave; capital e, grave accent
? &#201; &Eacute; capital e, acute accent
?

&#202; &Ecirc; capital e, circumflex accent
? &#203; &Euml; capital e, umlaut mark
? &#204; &Igrave; capital i, grave accent
? &#205; &Iacute; capital i, acute accent
? &#206; &Icirc; capital i, circumflex accent
?

&#207; &Iuml; capital i, umlaut mark
?

&#208; &ETH; capital eth, Icelandic
? &#209; &Ntilde; capital n, tilde
? &#210; &Ograve; capital o, grave accent
? &#211; &Oacute; capital o, acute accent
?

&#212; &Ocirc; capital o, circumflex accent
? &#213; &Otilde; capital o, tilde
? &#214; &Ouml; capital o, umlaut mark
?

&#216; &Oslash; capital o, slash
?

&#217; &Ugrave; capital u, grave accent
? &#218; &Uacute; capital u, acute accent
? &#219; &Ucirc; capital u, circumflex accent
? &#220; &Uuml; capital u, umlaut mark
? &#221; &Yacute; capital y, acute accent
? &#222; &THORN; capital THORN, Icelandic
? &#223; &szlig; small sharp s, German
à &#224; &agrave; small a, grave accent
á &#225; &aacute; small a, acute accent
? &#226; &acirc; small a, circumflex accent
?

&#227; &atilde; small a, tilde
?

&#228; &auml; small a, umlaut mark
? &#229; &aring; small a, ring
? &#230; &aelig; small ae
?

&#231; &ccedil; small c, cedilla
è &#232; &egrave; small e, grave accent
é &#233; &eacute; small e, acute accent
ê &#234; &ecirc; small e, circumflex accent
?

&#235; &euml; small e, umlaut mark
ì &#236; &igrave; small i, grave accent
í &#237; &iacute; small i, acute accent
? &#238; &icirc; small i, circumflex accent
?

&#239; &iuml; small i, umlaut mark
? &#240; &eth; small eth, Icelandic
? &#241; &ntilde; small n, tilde
ò &#242; &ograve; small o, grave accent
ó &#243; &oacute; small o, acute accent
?

&#244; &ocirc; small o, circumflex accent
?

&#245; &otilde; small o, tilde
?

&#246; &ouml; small o, umlaut mark
?

&#248; &oslash; small o, slash
ù &#249; &ugrave; small u, grave accent
ú &#250; &uacute; small u, acute accent
? &#251; &ucirc; small u, circumflex accent
ü &#252; &uuml; small u, umlaut mark
? &#253; &yacute; small y, acute accent
? &#254; &thorn; small thorn, Icelandic
?

&#255; &yuml; small y, umlaut mark

转载地址:http://ohesl.baihongyu.com/

你可能感兴趣的文章
iOS 依据文本内容为TextView动态定义高度
查看>>
UML类图几种关系的总结
查看>>
CCF系列之ISBN号码(201312-2)
查看>>
JDBC学习笔记(1)——JDBC概述
查看>>
iOS 中实现功能引导页面
查看>>
函数依赖的公理化系统
查看>>
Spring boot 启动过程解析 logback
查看>>
php实现简单视图模板(视图引擎)
查看>>
js事件之event.preventDefault()与event.stopPropagation()用法区别
查看>>
RDLC报表格式化format表达式
查看>>
ArcMap属性的列菜单简介
查看>>
【2011.9.20】基于CXF Web Service:Apache CXF简单部署 .
查看>>
jquery Flexigrid的使用
查看>>
Inotify + rsync
查看>>
中风从水治案
查看>>
SQL Server 内存使用量下降问题
查看>>
网络协议之socks---子网和公网的穿透
查看>>
网站flash黑屏问题
查看>>
JAVA TIMER定时器
查看>>
CCF-201512-3 绘图
查看>>