当前位置: 首页 > 文档资料 > HTML 入门教程 >

颜色名称(Color Names)

优质
小牛编辑
127浏览
2023-12-01

下表显示了HTML 3.2中引入的16种颜色名称 -

颜色名称十六进制值颜色show
aqua#00ffff00ffff
black#000000000000
blue#0000ff0000ff
fuchsia#ff00ffff00ff
green#008000008000
gray#808080808080
lime#00ff0000ff00
maroon#800000800000
navy#000080000080
olive#808000808000
purple#800080800080
red#ff0000ff0000
silver#c0c0c0c0c0c0
teal#008080008080
white#ffffffffffff
yellow#ffff00ffff00

还有其他颜色不属于HTML或XHTML,但大多数主流浏览器都支持它们。

颜色名称十六进制值颜色节目
aliceblue#f0f8fff0f8ff
antiquewhite#faebd7faebd7
aquamarine#7fffd47fffd4
azure#f0fffff0ffff
beige#f5f5dcf5f5dc
bisque#ffe4c4ffe4c4
blanchedalmond#ffebcdffebcd
blueviolet#8a2be28a2be2
brown#a52a2aa52a2a
burlywood#deb887deb887
cadetblue#5f9ea05f9ea0
chartreuse#7fff005f9ea0
chocolate#d2691ed2691e
coral#ff7f50ff7f50
cornflowerblue#6495ed6495ed
cornsilk#fff8dcfff8dc
crimson#dc143cdc143c
cyan#00ffff00ffff
darkblue#00008b00008b
darkcyan#008b8b008b8b
darkgoldenrod#b8860bb8860b
darkgray#a9a9a9a9a9a9
darkgreen#006400006400
darkkhaki#bdb76bbdb76b
darkmagenta#8b008b8b008b
darkolivegreen#556b2f556b2f
darkorange#ff8c00ff8c00
darkorchid#9932cc9932cc
darkred#8b00008b0000
darksalmon#e9967ae9967a
darkseagreen#8fbc8f8fbc8f
darkslateblue#483d8b483d8b
darkslategray#2f4f4f2f4f4f
darkturquoise#00ced100ced1
darkviolet#9400d39400d3
deeppink#ff1493ff1493
deepskyblue#00bfff00bfff
dimgray#696969696969
dodgerblue#1e90ff1e90ff
firebrick#b22222b22222
floralwhite#fffaf0fffaf0
forestgreen#228b22228b22
gainsboro#dcdcdcdcdcdc
ghostwhite#f8f8fff8f8ff
gold#ffd700ffd700
goldenrod#daa520daa520
gray#808080808080
greenyellow#adff2fadff2f
honeydew#f0fff0f0fff0
hotpink#ff69b4ff69b4
indianred#cd5c5ccd5c5c
indigo#4b00824b0082
ivory#fffff0fffff0
khaki#f0e68cf0e68c
lavender#e6e6fae6e6fa
lavenderblush#fff0f5fff0f5
lawngreen#7cfc007cfc00
lemonchiffon#fffacdfffacd
lightblue#add8e6add8e6
lightcoral#f08080f08080
lightcyan#e0ffffe0ffff
lightgoldenrodyellow#fafad2fafad2
lightgreen#90ee9090ee90
lightgrey#d3d3d3d3d3d3
lightpink#ffb6c1ffb6c1
lightsalmon#ffa07affa07a
lightseagreen#20b2aa20b2aa
lightskyblue#87cefa87cefa
lightslategray#778899778899
lightsteelblue#b0c4deb0c4de
lightyellow#ffffe0ffffe0
limegreen#32cd3232cd32
linen#faf0e6faf0e6
magenta#ff00ffff00ff
mediumblue#0000cd0000cd
mediumorchid#ba55d3ba55d3
mediumpurple#9370db9370db
midnightblue#191970191970
mistyrose#ffe4e1ffe4e1
moccasin#ffe4b5ffe4b5
oldlace#fdf5e6fdf5e6
orange#ffa500ffa500
orchid#da70d6da70d6
peachpuff#ffdab9ffdab9
peru#cd853fcd853f
pink#ffc0cbffc0cb
plum#dda0dddda0dd
purple#800080800080
rosybrown#bc8f8fbc8f8f
royalblue#4169e14169e1
salmon#fa8072fa8072
sandybrown#f4a460f4a460
seagreen#2e8b572e8b57
sienna#a0522da0522d
skyblue#87ceeb87ceeb
slateblue#6a5acd6a5acd
steelblue#4682b44682b4
tan#d2b48cd2b48c
thistle#d8bfd8d8bfd8
tomato#ff6347ff6347
violet#ee82eeee82ee
wheat#f5deb3f5deb3
whitesmoke#f5f5f5f5f5f5
yellow#ffff00ffff00
yellowgreen#9acd329acd32

HTML实体

某些字符在HTML中保留,在HTML文档中使用时具有特殊含义。 例如,您不能在HTML文本中使用大于或小于标记或尖括号,因为浏览器会以不同方式对待它们,并尝试绘制与HTML标记相关的含义。

HTML处理器必须支持下表中列出的以下五个特殊字符。

符号描述实体名称数字代码
"quotation mark""
'apostrophe ''
&ampersand&&
<less-than&lt;<
>greater-than&gt;>

例子 (Example)

如果你想写

作为代码,那么你必须写如下 -
<!DOCTYPE html>
<html>
   <head>
      <title>HTML Entities</title>
   </head>
   <body>
      <div id = "character">
   </body>
</html>

HTML 4.0中还有一长串特殊字符。 为了使它们出现在您的文档中,您可以使用数字代码或实体名称。 例如,要插入版权符号,您可以使用以下任一项 -

© 2007
or
© 2007

ISO 8859-1符号实体

结果描述实体名称数字代码
non-breaking space&nbsp; 
¡inverted exclamation mark&iexcl;¡
¤currency&curren;¤
¢cent&cent;¢
£pound&pound;£
¥yen&yen;¥
¦broken vertical bar&brvbar;¦
§section&sect;§
¨spacing diaeresis&uml;¨
©copyright&copy;©
ªfeminine ordinal indicator&ordf;ª
«angle quotation mark (left)&laquo;«
¬negation&not;¬
­soft hyphen&shy;­
®注册商标&reg;®
trademark&trade;
¯spacing macron&macr;¯
°degree&deg;°
±plus-or-minus &plusmn;±
²上标2&sup2;²
³上标3&sup3;³
´spacing acute&acute;´
µmicro&micro;µ
paragraph&para;
·中间点&middot;·
¸spacing cedilla&cedil;¸
¹上标1&sup1;¹
ºmasculine ordinal indicator&ordm;º
»angle quotation mark (right)&raquo;»
¼fraction 1/4&frac14;¼
½fraction 1/2&frac12;½
¾fraction 3/4&frac34;¾
¿inverted question mark&iquest;¿
×乘法&times;×
÷division&divide;÷

ISO 8859-1字符实体

结果描述实体名称数字代码
Àcapital a, grave accent&Agrave;À
Ácapital a, acute accent&Aacute;Á
Âcapital a, circumflex accent&Acirc;Â
Ãcapital a, tilde&Atilde;Ã
Äcapital a, umlaut mark&Auml;Ä
Åcapital a, ring&Aring;Å
Æcapital ae&AElig;Æ
Çcapital c, cedilla&Ccedil;Ç
Ècapital e, grave accent&Egrave;È
Écapital e, acute accent&Eacute;É
Êcapital e, circumflex accent&Ecirc;Ê
Ëcapital e, umlaut mark&Euml;Ë
Ìcapital i, grave accent&Igrave;Ì
Ícapital i, acute accent&Iacute;Í
Îcapital i, circumflex accent&Icirc;Î
Ï资本i,umlaut mark&Iuml;Ï
Ðcapital eth, Icelandic&ETH;Ð
Ñcapital n, tilde&Ntilde;Ñ
Òcapital o, grave accent&Ograve;Ò
Ócapital o, acute accent&Oacute;Ó
Ôcapital o, circumflex accent&Ocirc;Ô
Õcapital o, tilde&Otilde;Õ
Öcapital o, umlaut mark&Ouml;Ö
Øcapital o, slash&Oslash;Ø
Ùcapital u, grave accent&Ugrave;Ù
Úcapital u, grave accent&Uacute;Ú
Ûcapital u, circumflex accent&Ucirc;Û
Ücapital u, umlaut mark&Uuml;Ü
Ýcapital y, acute accent&Yacute;Ý
Þcapital THORN, Icelandic&THORN;Þ
ßsmall sharp s, German&szlig;ß
àsmall a, grave accent&agrave;à
ásmall a, acute accent&aacute;á
âsmall a, circumflex accent&acirc;â
ãsmall a, tilde&atilde;ã
äsmall a, umlaut mark&auml;ä
åsmall a, ring&aring;å
æ小ae&aelig;æ
çsmall c, cedilla&ccedil;ç
èsmall e, grave accent&egrave;è
ésmall e, acute accent&eacute;é
êsmall e, circumflex accent&ecirc;ê
ësmall e, umlaut mark&euml;ë
ìsmall i, grave accent&igrave;ì
ísmall i, acute accent&iacute;í
îsmall i, circumflex accent&icirc;î
ïsmall i, umlaut mark&iuml;ï
ðsmall eth, Icelandic&eth;ð
ñsmall n, tilde&ntilde;ñ
òsmall o, grave accent&ograve;ò
ósmall o, acute accent&oacute;ó
ôsmall o, circumflex accent&ocirc;ô
õsmall o, tilde&otilde;õ
ösmall o, umlaut mark&ouml;ö
øsmall o, slash&oslash;ø
ùsmall u, grave accent&ugrave;ù
úsmall u, acute accent&uacute;ú
ûsmall u, circumflex accent&ucirc;û
üsmall u, umlaut mark&uuml;ü
ýsmall y, acute accent&yacute;ý
þsmall thorn, Icelandic&thorn;þ
ÿsmall y, umlaut mark&yuml;ÿ

HTML浏览器支持的其他实体

结果描述实体名称数字代码
Œcapital ligature OE&OElig;Œ
œsmall ligature oe&oelig;œ
Šcapital S with caron&Scaron;Š
šsmall S with caron&scaron;š
Ÿcapital Y with diaeres&Yuml;Ÿ
ˆmodifier letter circumflex accent&circ;ˆ
˜小波浪&tilde;˜
en space&ensp;
em space&emsp;
thin space&thinsp;
零宽度非连接器&zwnj;
zero width joiner&zwj;
从左到右的标记&lrm;
从右到左的标记&rlm;
en dash&ndash;
em dash&mdash;
left single quotation mark&lsquo;
right single quotation mark&rsquo;
single low-9 quotation mark&sbquo;
left double quotation mark&ldquo;
right double quotation mark&rdquo;
double low-9 quotation mark&bdquo;
dagger&dagger;
Double dagger&Dagger;
horizontal ellipsis&hellip;
per mille&permil;
single left-pointing angle quotation&lsaquo;
single right-pointing angle quotation&rsaquo;
euro&euro;