HTML 的顏色表示可分兩種:
● 以命名方式定義常用的顏色,如 RED。
● 以 RGB 值表示,如 #FF0000 表示 red。
命名方式涵括的色種不多亦不甚方便,較少采用,以下介紹 RGB 值的原理:
眾所皆知顏色是由 "red" "green" "blue" 三原色組合而成的,在 HTML 中對於彩度的定義是 采十六進位的,對於三原色 HTML 分別給予兩個十六進位去定義,也就是每個原色可有 256 種彩度,故此三原色可混合成一千六佰多萬的顏色。
例如
白色的組成是 red=ff, green=ff, blue=ff, RGB 值即為 ffffff
紅色的組成是 red=ff, green=00, blue=00, RGB 值即為 ff0000
綠色的組成是 red=00, green=ff, blue=00, RGB 值即為 00ff00
藍色的組成是 red=00, green=00, blue=ff, RGB 值即為 0000ff
黑色的組成是 red=00, green=00, blue=00, RGB 值即為 000000
於應用時常在每個 RGB 值之前加上符號 # 以示分別,但不加亦可。
■ HTML 基本架構:
選按不同顏色按鍵以測試前景顏色效果 (只適合 Internet Explorer) 選按不同顏色按鍵以測試背景顏色效果 |
■ 16 常用顏色表:
Color | Value | Name | Color | Value | Name | |
#00FFFF | aqua | #808080 | gray | |||
#000080 | navy | #C0C0C0 | silver | |||
#000000 | black | #008000 | green | |||
#808000 | olive | #008080 | teal | |||
#0000FF | blue | #00FF00 | lime | |||
#800080 | purple | #FFFF00 | yellow | |||
#FF00FF | fuchsia | #800000 | maroon | |||
#FF0000 | red | #FFFFFF | white |
■ 其它常用顏色表:
Color | Value | Name | Color | Value | Name | |
#F0F8FF | aliceblue | #A00000 | antiquewith | |||
#7FFFD4 | aquamarine | #F0FFFF | azure | |||
#F5F5DC | beige | #FFE4C4 | bisque | |||
#000000 | black | #FFEBCD | blanchedalmond | |||
#0000FF | blue | #8A2BE2 | blueviolet | |||
#A52A2A | brown | #DEB887 | burlywood | |||
#5F9EA0 | cadetblue | #7FFF00 | chartreuse | |||
#D2691E | chocolate | #FF7F50 | coral | |||
#C0F000 | cornfloewrblue | #FFF8DC | cornsilk | |||
#00FFFF | cyan | #00008B | darkblue | |||
#008B8B | darkcyan | #B8860B | darkgoldenrod | |||
#A9A9A9 | darkgray | #006400 | darkgreen | |||
#DA0000 | darkhaki | #8B008B | darkmagenta | |||
#556B2F | darkolivegreen | #DA000E | darkorenge | |||
#9932CC | darkorchid | #8B0000 | darkred | |||
#E9967A | darksalmon | #8FBC8F | darkseagreen | |||
#483D8B | darkslateblue | #2F4F4F | darkslategray | |||
#00CED1 | darkturquoise | #9400D3 | darkviolet | |||
#FF1493 | deeppink | #00BFFF | deepskyblue | |||
#696969 | dimgray | #1E90FF | dodgerblue | |||
#B22222 | firebrick | #FFFAF0 | floralwhite | |||
#228B22 | forestgreen | #DCDCDC | gainsboro | |||
#00000E | gostwhite | #FFD700 | gold | |||
#00E00D | golenrod | #808080 | gray | |||
#008000 | green | #ADFF2F | greenyellow | |||
#F0FFF0 | honeydew | #FF69B4 | hotpink | |||
#CD5C5C | indianred | #FFFFF0 | ivory | |||
#F0E68C | khaki | #E6E6FA | lavender | |||
#FFF0F5 | lavenderblush | #7CFC00 | lawngreen | |||
#FFFACD | lemonchiffon | #ADD8E6 | lightblue | |||
#F08080 | lightcoral | #E0FFFF | lightcyan | |||
#0000E0 | lightgodenrod | #0000E0 | lightgodenrodyellow | |||
#0000A0 | lightgray | #90EE90 | lightgreen | |||
#FFB6C1 | lightpink | #FFA07A | lightsalmon | |||
#20B2AA | lightseagreen | #87CEFA | lightskyblue | |||
#0000EB | lightslateblue | #778899 | lightslategray | |||
#B0C4DE | lightsteelblue | #FFFFE0 | lightyellow | |||
#32CD32 | limegreen | #FAF0E6 | linen | |||
#FF00FF | magenta | #800000 | maroon | |||
#66CDAA | mediumaquamarine | #0000CD | mediumblue | |||
#BA55D3 | mediumorchid | #ED0000 | mediumpurpul | |||
#3CB371 | mediumseagreen | #7B68EE | mediumslateblue | |||
#00FA9A | mediumspringgreen | #48D1CC | mediumturquoise | |||
#C71585 | mediumvioletred | #191970 | midnightblue | |||
#F5FFFA | mintcream | #FFE4E1 | mistyrose | |||
#FFE4B5 | moccasin | #FFDEAD | navajowhite | |||
#000080 | navy | #A0B0E0 | navyblue | |||
#FDF5E6 | oldlace | #6B8E23 | olivedrab | |||
#FFA500 | orange | #0E0EED | orengered | |||
#DA70D6 | orchid | #A00D00 | palegodenrod | |||
#98FB98 | palegreen | #AFEEEE | paleturquoise | |||
#DB7093 | palevioletred | #FFEFD5 | papayawhip | |||
#FFDAB9 | peachpuff | #CD853F | peru | |||
#FFC0CB | pink | #DDA0DD | plum | |||
#B0E0E6 | powderblue | #800080 | purple | |||
#FF0000 | red | #BC8F8F | rosybrown | |||
#4169E1 | royalblue | #8B4513 | saddlebrown | |||
#FA8072 | salmon | #F4A460 | sandybrown | |||
#2E8B57 | seagreen | #FFF5EE | seashell | |||
#A0522D | sienna | #87CEEB | skyblue | |||
#6A5ACD | slateblue | #708090 | slategray | |||
#FFFAFA | snow | #00FF7F | springgreen | |||
#4682B4 | steelblue | #D2B48C | tan | |||
#D8BFD8 | thistle | #FF6347 | tomato | |||
#40E0D0 | turquoise | #EE82EE | violet | |||
#00E0ED | violetred | #F5DEB3 | wheat | |||
#000E00 | hite | #F5F5F5 | whitesmoke | |||
#FFFF00 | yellow |
推薦設計
優秀海報設計精選集(8)海報設計2022-09-23
充滿自然光線!32平米精致裝修設計2022-08-14
親愛的圖書館 | VERSE雜誌版版式設計2022-07-11
生活,就該這麼愛!2022天海報設計2022-06-02
最新文章
帶你輕鬆打開SVG動畫的大HTML教程2016-06-08
36個重要的HTML標簽HTML教程2012-05-15
10個最容易犯的HTML標簽錯HTML教程2010-09-11
border:none;與border:0;的區別HTML教程2009-11-26