CSS ColorCSS Color Properties| HTML Tag | CSS Property | Description |
|---|
| all | color | set element color | | all | background-color | set element background color | | all | border-color | set element 4 borders color |
CSS Code Example/* All tags below will have blue color */ H1 { color: blue } H2 { color: rgb(0,0,255) } H3 { color: rgb(0%,0%,100%) } H4 { color: #0000FF } CSS Background ColorExample:H1 { background-color: #333333 } .code { background-color: #dddddd } CSS Link ColorExample:a:link { color: #0000cc; text-decoration: none; } a:visited { color: #cc00cc; text-decoration: none; } a:active { color: #cc00cc; text-decoration: underline; } a:hover { color: #0000ff; text-decoration: underline; } a: { background-color: #808080; outline: none; } CSS Text ColorExample:BODY { color: black } P { color: #0000ff } H1 { color: #808000 } CSS Color Names and Hex Codes Table| | black | #000000 | rgb(0,0,0) | | | silver | #C0C0C0 | rgb(192,192,192) | | | gray | #808080 | rgb(128,128,128) | | | white | #FFFFFF | rgb(255,255,255) | | | purple | #800080 | rgb(128,0,128) | | | fuchsia | #FF00FF | rgb(255,0,255) | | | maroon | #800000 | rgb(128,0,0) | | | red | #FF0000 | rgb(255,0,0) | | | olive | #808000 | rgb(128,128,0) | | | yellow | #FFFF00 | rgb(255,255,0) | | | green | #008000 | rgb(0,128,0) | | | lime | #00FF00 | rgb(0,255,0) | | | teal | #008080 | rgb(0,128,128) | | | aqua | #00FFFF | rgb(0,255,255) | | | navy | #000080 | rgb(0,0,128) | | | blue | #0000FF | rgb(0,0,255) |
See also
|