您的位置:首页 > Web前端 > HTML

HTML - HTML Commonly Used Character Entities

2014-08-27 16:27 204 查看


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: < or <


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

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


HTML Entities Example

Experiment with HTML character entities: Try
it yourself


HTML Useful Character Entities

Note: Entity names are case sensitive!
ResultDescriptionEntity NameEntity Number
non-breaking space  
<less than<<
>greater than>>
&ampersand&&
?cent¢¢
?pound££
?yen¥¥
?euro
§section§§
?copyright©©
?registered trademark®®
?trademark
For a complete reference of all character entities, visit our HTML Entities
Reference.


HTML ISO-8859-1 Reference

? Previous
Next Reference
?

Modern browsers supports several character-sets:

ASCII character set
Standard ISO character sets
Mathematical symbols, Greek letters, and other symbols


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:
CharacterEntity NumberEntity NameDescription
"""quotation mark
'''apostrophe
&&&ampersand
<<<less-than
>>>greater-than
Note: Entity names are case sensitive!


ISO 8859-1 Symbols

CharacterEntity NumberEntity NameDescription
  non-breaking space
?¡¡inverted exclamation mark
?¢¢cent
?££pound
¤¤¤currency
?¥¥yen
?¦¦broken vertical bar
§§§section
¨¨¨spacing diaeresis
?©©copyright
?ªªfeminine ordinal indicator
?««angle quotation mark (left)
?¬¬negation
­­soft hyphen
?®®registered trademark
?¯¯spacing macron
°°°degree
±±±plus-or-minus
?²²superscript 2
?³³superscript 3
?´´spacing acute
?µµmicro
?paragraph
···middle dot
?¸¸spacing cedilla
?¹¹superscript 1
?ººmasculine ordinal indicator
?»»angle quotation mark (right)
?¼¼fraction 1/4
?½½fraction 1/2
?¾¾fraction 3/4
?¿¿inverted question mark
×××multiplication
÷÷÷division


ISO 8859-1 Characters

CharacterEntity NumberEntity NameDescription
?ÀÀcapital a, grave accent
?ÁÁcapital a, acute accent
?ÂÂcapital a, circumflex accent
?ÃÃcapital a, tilde
?ÄÄcapital a, umlaut mark
?ÅÅcapital a, ring
?ÆÆcapital ae
?ÇÇcapital c, cedilla
?ÈÈcapital e, grave accent
?ÉÉcapital e, acute accent
?ÊÊcapital e, circumflex accent
?ËËcapital e, umlaut mark
?ÌÌcapital i, grave accent
?ÍÍcapital i, acute accent
?ÎÎcapital i, circumflex accent
?ÏÏcapital i, umlaut mark
?ÐÐcapital eth, Icelandic
?ÑÑcapital n, tilde
?ÒÒcapital o, grave accent
?ÓÓcapital o, acute accent
?ÔÔcapital o, circumflex accent
?ÕÕcapital o, tilde
?ÖÖcapital o, umlaut mark
?ØØcapital o, slash
?ÙÙcapital u, grave accent
?ÚÚcapital u, acute accent
?ÛÛcapital u, circumflex accent
?ÜÜcapital u, umlaut mark
?ÝÝcapital y, acute accent
?ÞÞcapital THORN, Icelandic
?ßßsmall sharp s, German
àààsmall a, grave accent
ááásmall a, acute accent
?ââsmall a, circumflex accent
?ããsmall a, tilde
?ääsmall a, umlaut mark
?ååsmall a, ring
?ææsmall ae
?ççsmall c, cedilla
èèèsmall e, grave accent
ééésmall e, acute accent
êêêsmall e, circumflex accent
?ëësmall e, umlaut mark
ìììsmall i, grave accent
ííísmall i, acute accent
?îîsmall i, circumflex accent
?ïïsmall i, umlaut mark
?ððsmall eth, Icelandic
?ññsmall n, tilde
òòòsmall o, grave accent
óóósmall o, acute accent
?ôôsmall o, circumflex accent
?õõsmall o, tilde
?öösmall o, umlaut mark
?øøsmall o, slash
ùùùsmall u, grave accent
úúúsmall u, acute accent
?ûûsmall u, circumflex accent
üüüsmall u, umlaut mark
?ýýsmall y, acute accent
?þþsmall thorn, Icelandic
?ÿÿsmall y, umlaut mark

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: