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

本文共 6234 字,大约阅读时间需要 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 mar

k

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

你可能感兴趣的文章
为什么编程语言以及数据库要从1970年1月1日开始计算时
查看>>
java web -- EL表达式
查看>>
模拟器收短信和接电话的方法
查看>>
poj2771
查看>>
(转)反射-实例化类
查看>>
OGRE 阴影技术官方文档
查看>>
Trie 树内存消耗问题
查看>>
提供一个Cookies操作类(支持带域名与不带域名)IP和localhost域名调试
查看>>
iPhone的Push(推送通知)功能原理浅析
查看>>
php curl打开网页
查看>>
工信部提醒消费者谨防手机预置恶意插件
查看>>
金山发布3月安全报告 肉鸡网银挂马成安全成焦点
查看>>
poj3194
查看>>
OGRE手札-39 碰撞检测
查看>>
重读<算法导论>
查看>>
Oracle 11g Release 1 (11.1) 游标——SQL 游标(隐式)
查看>>
(笔试题)应聘iphone开发工程师,iphone和Objective-C的笔试题? (http://www.cocoachina.com/bbs/simple/?t44281.html)...
查看>>
欧拉函数
查看>>
C++之private虚函数
查看>>
水晶易表调用C#的WebService,返回数据集合
查看>>