下表顯示了HTML 3.2中引入的16個顏色名−
Color Name | Hex Value | Color | Show |
---|---|---|---|
aqua | #00ffff | Demo | |
black | #000000 | Demo | |
blue | #0000ff | Demo | |
fuchsia | #ff00ff | Demo | |
green | #008000 | Demo | |
gray | #808080 | Demo | |
lime | #00ff00 | Demo | |
maroon | #800000 | Demo | |
navy | #000080 | Demo | |
olive | #808000 | Demo | |
purple | #800080 | Demo | |
red | #ff0000 | Demo | |
silver | #c0c0c0 | Demo | |
teal | #008080 | Demo | |
white | #ffffff | Demo | |
yellow | #ffff00 | Demo |
還有一些其他顏色不是HTML或XHTML的一部分,但是它們被大多數主流瀏覽器的版本所支持。
Color Name | Hex Value | Color | Show |
---|---|---|---|
aliceblue | #f0f8ff | Demo | |
antiquewhite | #faebd7 | Demo | |
aquamarine | #7fffd4 | Demo | |
azure | #f0ffff | Demo | |
beige | #f5f5dc | Demo | |
bisque | #ffe4c4 | Demo | |
blanchedalmond | #ffebcd | Demo | |
blueviolet | #8a2be2 | Demo | |
brown | #a52a2a | Demo | |
burlywood | #deb887 | Demo | |
cadetblue | #5f9ea0 | Demo | |
chartreuse | #7fff00 | Demo | |
chocolate | #d2691e | Demo | |
coral | #ff7f50 | Demo | |
cornflowerblue | #6495ed | Demo | |
cornsilk | #fff8dc | Demo | |
crimson | #dc143c | Demo | |
cyan | #00ffff | Demo | |
darkblue | #00008b | Demo | |
darkcyan | #008b8b | Demo | |
darkgoldenrod | #b8860b | Demo | |
darkgray | #a9a9a9 | Demo | |
darkgreen | #006400 | Demo | |
darkkhaki | #bdb76b | Demo | |
darkmagenta | #8b008b | Demo | |
darkolivegreen | #556b2f | Demo | |
darkorange | #ff8c00 | Demo | |
darkorchid | #9932cc | Demo | |
darkred | #8b0000 | Demo | |
darksalmon | #e9967a | Demo | |
darkseagreen | #8fbc8f | Demo | |
darkslateblue | #483d8b | Demo | |
darkslategray | #2f4f4f | Demo | |
darkturquoise | #00ced1 | Demo | |
darkviolet | #9400d3 | Demo | |
deeppink | #ff1493 | Demo | |
deepskyblue | #00bfff | Demo | |
dimgray | #696969 | Demo | |
dodgerblue | #1e90ff | Demo | |
firebrick | #b22222 | Demo | |
floralwhite | #fffaf0 | Demo | |
forestgreen | #228b22 | Demo | |
gainsboro | #dcdcdc | Demo | |
ghostwhite | #f8f8ff | Demo | |
gold | #ffd700 | Demo | |
goldenrod | #daa520 | Demo | |
gray | #808080 | Demo | |
greenyellow | #adff2f | Demo | |
honeydew | #f0fff0 | Demo | |
hotpink | #ff69b4 | Demo | |
indianred | #cd5c5c | Demo | |
indigo | #4b0082 | Demo | |
ivory | #fffff0 | Demo | |
khaki | #f0e68c | Demo | |
lavender | #e6e6fa | Demo | |
lavenderblush | #fff0f5 | Demo | |
lawngreen | #7cfc00 | Demo | |
lemonchiffon | #fffacd | Demo | |
lightblue | #add8e6 | Demo | |
lightcoral | #f08080 | Demo | |
lightcyan | #e0ffff | Demo | |
lightgoldenrodyellow | #fafad2 | Demo | |
lightgreen | #90ee90 | Demo | |
lightgrey | #d3d3d3 | Demo | |
lightpink | #ffb6c1 | Demo | |
lightsalmon | #ffa07a | Demo | |
lightseagreen | #20b2aa | Demo | |
lightskyblue | #87cefa | Demo | |
lightslategray | #778899 | Demo | |
lightsteelblue | #b0c4de | Demo | |
lightyellow | #ffffe0 | Demo | |
limegreen | #32cd32 | Demo | |
linen | #faf0e6 | Demo | |
magenta | #ff00ff | Demo | |
mediumblue | #0000cd | Demo | |
mediumorchid | #ba55d3 | Demo | |
mediumpurple | #9370db | Demo | |
midnightblue | #191970 | Demo | |
mistyrose | #ffe4e1 | Demo | |
moccasin | #ffe4b5 | Demo | |
oldlace | #fdf5e6 | Demo | |
orange | #ffa500 | Demo | |
orchid | #da70d6 | Demo | |
peachpuff | #ffdab9 | Demo | |
peru | #cd853f | Demo | |
pink | #ffc0cb | Demo | |
plum | #dda0dd | Demo | |
purple | #800080 | Demo | |
rosybrown | #bc8f8f | Demo | |
royalblue | #4169e1 | Demo | |
salmon | #fa8072 | Demo | |
sandybrown | #f4a460 | Demo | |
seagreen | #2e8b57 | Demo | |
sienna | #a0522d | Demo | |
skyblue | #87ceeb | Demo | |
slateblue | #6a5acd | Demo | |
steelblue | #4682b4 | Demo | |
tan | #d2b48c | Demo | |
thistle | #d8bfd8 | Demo | |
tomato | #ff6347 | Demo | |
violet | #ee82ee | Demo | |
wheat | #f5deb3 | Demo | |
whitesmoke | #f5f5f5 | Demo | |
yellow | #ffff00 | Demo | |
yellowgreen | #9acd32 | Demo |
HTML Entities
有些字符是在HTML中保留的,它們在HTML文檔中有特殊的含義。例如,不能在HTML文本中使用大於和小於號或尖括號,因爲瀏覽器將對它們進行不同的處理,並嘗試繪製與HTML標記相關的含義。
HTML處理器必須支持下表中列出的以下五個特殊字符。
Symbol | Description | Entity Name | Number Code |
---|---|---|---|
" | quotation mark | " | " |
' | apostrophe | ' | ' |
& | ampersand | & | & |
< | less-than | < | < |
> | greater-than | > | > |
Example
如果要將<div id=「character」>作爲代碼編寫,則必須按以下方式編寫&負;
<!DOCTYPE html> <html> <head> <title>HTML Entities</title> </head> <body> <div id = "character"> </body> </html>
這將產生以下結果&負;
在HTML4.0中還有一長串特殊字符。爲了使這些內容出現在文檔中,可以使用數字代碼或實體名稱。例如,若要插入版權符號,可以使用以下任一項−